830-v6.4-25-Revert-thermal-drivers-mediatek-Use-devm_of_iomap-to.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From 2c380d07215e6fce3ac66cc5af059bc2c2a69f7a Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Ricardo=20Ca=C3=B1uelo?= <[email protected]>
  3. Date: Thu, 25 May 2023 14:18:11 +0200
  4. Subject: [PATCH 21/42] Revert "thermal/drivers/mediatek: Use devm_of_iomap to
  5. avoid resource leak in mtk_thermal_probe"
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. This reverts commit f05c7b7d9ea9477fcc388476c6f4ade8c66d2d26.
  10. That change was causing a regression in the generic-adc-thermal-probed
  11. bootrr test as reported in the kernelci-results list [1].
  12. A proper rework will take longer, so revert it for now.
  13. [1] https://groups.io/g/kernelci-results/message/42660
  14. Fixes: f05c7b7d9ea9 ("thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe")
  15. Signed-off-by: Ricardo Cañuelo <[email protected]>
  16. Suggested-by: AngeloGioacchino Del Regno <[email protected]>
  17. Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
  18. Signed-off-by: Daniel Lezcano <[email protected]>
  19. Link: https://lore.kernel.org/r/[email protected]
  20. ---
  21. drivers/thermal/mediatek/auxadc_thermal.c | 14 ++------------
  22. 1 file changed, 2 insertions(+), 12 deletions(-)
  23. --- a/drivers/thermal/mediatek/auxadc_thermal.c
  24. +++ b/drivers/thermal/mediatek/auxadc_thermal.c
  25. @@ -1222,12 +1222,7 @@ static int mtk_thermal_probe(struct plat
  26. return -ENODEV;
  27. }
  28. - auxadc_base = devm_of_iomap(&pdev->dev, auxadc, 0, NULL);
  29. - if (IS_ERR(auxadc_base)) {
  30. - of_node_put(auxadc);
  31. - return PTR_ERR(auxadc_base);
  32. - }
  33. -
  34. + auxadc_base = of_iomap(auxadc, 0);
  35. auxadc_phys_base = of_get_phys_base(auxadc);
  36. of_node_put(auxadc);
  37. @@ -1243,12 +1238,7 @@ static int mtk_thermal_probe(struct plat
  38. return -ENODEV;
  39. }
  40. - apmixed_base = devm_of_iomap(&pdev->dev, apmixedsys, 0, NULL);
  41. - if (IS_ERR(apmixed_base)) {
  42. - of_node_put(apmixedsys);
  43. - return PTR_ERR(apmixed_base);
  44. - }
  45. -
  46. + apmixed_base = of_iomap(apmixedsys, 0);
  47. apmixed_phys_base = of_get_phys_base(apmixedsys);
  48. of_node_put(apmixedsys);