1
0

0514-net-mediatek-fix_esw.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --- a/drivers/net/ethernet/mediatek/esw_rt3050.c
  2. +++ b/drivers/net/ethernet/mediatek/esw_rt3050.c
  3. @@ -16,6 +16,7 @@
  4. #include <linux/kernel.h>
  5. #include <linux/platform_device.h>
  6. #include <asm/mach-ralink/ralink_regs.h>
  7. +#include <linux/of_irq.h>
  8. #include <linux/switch.h>
  9. @@ -1332,7 +1333,6 @@ static int esw_probe(struct platform_dev
  10. const __be32 *port_map, *reg_init;
  11. struct switch_dev *swdev;
  12. struct rt305x_esw *esw;
  13. - struct resource *irq;
  14. int ret;
  15. esw = devm_kzalloc(&pdev->dev, sizeof(*esw), GFP_KERNEL);
  16. @@ -1340,7 +1340,7 @@ static int esw_probe(struct platform_dev
  17. return -ENOMEM;
  18. esw->dev = &pdev->dev;
  19. - esw->irq = irq->start;
  20. + esw->irq = irq_of_parse_and_map(np, 0);
  21. esw->base = devm_ioremap_resource(&pdev->dev, res);
  22. if (!esw->base)
  23. return -EADDRNOTAVAIL;
  24. @@ -1365,7 +1365,7 @@ static int esw_probe(struct platform_dev
  25. ret = register_switch(swdev, NULL);
  26. if (ret < 0) {
  27. dev_err(&pdev->dev, "register_switch failed\n");
  28. - goto unmap_base;
  29. + return ret;
  30. }
  31. platform_set_drvdata(pdev, esw);
  32. @@ -1383,11 +1383,6 @@ static int esw_probe(struct platform_dev
  33. }
  34. return ret;
  35. -
  36. -unmap_base:
  37. - iounmap(esw->base);
  38. - kfree(esw);
  39. - return ret;
  40. }
  41. static int esw_remove(struct platform_device *pdev)