Advertisement
trini

edma2.patch

Oct 15th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
  2. index fd039db..0997a63 100644
  3. --- a/arch/arm/common/edma.c
  4. +++ b/arch/arm/common/edma.c
  5. @@ -1564,9 +1564,9 @@ static int __init edma_probe(struct platform_device *pdev)
  6. struct device_node *node = pdev->dev.of_node;
  7. struct device *dev = &pdev->dev;
  8. struct edma_soc_info *pdata;
  9. + int ret;
  10.  
  11. if (node) {
  12. - int ret;
  13. pdata = devm_kzalloc(dev,
  14. sizeof(struct edma_soc_info),
  15. GFP_KERNEL);
  16. @@ -1588,15 +1588,18 @@ static int __init edma_probe(struct platform_device *pdev)
  17. return -ENODEV;
  18.  
  19. for (j = 0; j < EDMA_MAX_CC; j++) {
  20. + if (!info[j]) {
  21. + if (found)
  22. + break;
  23. + else
  24. + return -ENODEV;
  25. + }
  26. if (node) {
  27. - int err;
  28. - err = of_address_to_resource(node, 0, &res[j]);
  29. - if (err) {
  30. - dev_err(dev,
  31. - "unable to find 'reg' property\n");
  32. - return -EIO;
  33. - }
  34. - r[j] = &res[j];
  35. + ret = of_address_to_resource(node, j, &res[j]);
  36. + if (IS_ERR_VALUE(ret))
  37. + r[j] = NULL;
  38. + else
  39. + r[j] = &res[j];
  40.  
  41. } else {
  42. sprintf(res_name, "edma_cc%d", j);
  43. @@ -1604,7 +1607,7 @@ static int __init edma_probe(struct platform_device *pdev)
  44. IORESOURCE_MEM,
  45. res_name);
  46. }
  47. - if (!r[j] || !info[j]) {
  48. + if (!r[j]) {
  49. if (found)
  50. break;
  51. else
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement