Advertisement
trini

edma3.patch

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