c3ff17d5173e5c8aaa6606073964c088e665da74
[openwrt/staging/ldir.git] /
1 From 2c380d07215e6fce3ac66cc5af059bc2c2a69f7a Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ricardo=20Ca=C3=B1uelo?= <ricardo.canuelo@collabora.com>
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
10 This reverts commit f05c7b7d9ea9477fcc388476c6f4ade8c66d2d26.
11
12 That change was causing a regression in the generic-adc-thermal-probed
13 bootrr test as reported in the kernelci-results list [1].
14 A proper rework will take longer, so revert it for now.
15
16 [1] https://groups.io/g/kernelci-results/message/42660
17
18 Fixes: f05c7b7d9ea9 ("thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe")
19 Signed-off-by: Ricardo CaƱuelo <ricardo.canuelo@collabora.com>
20 Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
21 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
22 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
23 Link: https://lore.kernel.org/r/20230525121811.3360268-1-ricardo.canuelo@collabora.com
24 ---
25 drivers/thermal/mediatek/auxadc_thermal.c | 14 ++------------
26 1 file changed, 2 insertions(+), 12 deletions(-)
27
28 --- a/drivers/thermal/mediatek/auxadc_thermal.c
29 +++ b/drivers/thermal/mediatek/auxadc_thermal.c
30 @@ -1222,12 +1222,7 @@ static int mtk_thermal_probe(struct plat
31 return -ENODEV;
32 }
33
34 - auxadc_base = devm_of_iomap(&pdev->dev, auxadc, 0, NULL);
35 - if (IS_ERR(auxadc_base)) {
36 - of_node_put(auxadc);
37 - return PTR_ERR(auxadc_base);
38 - }
39 -
40 + auxadc_base = of_iomap(auxadc, 0);
41 auxadc_phys_base = of_get_phys_base(auxadc);
42
43 of_node_put(auxadc);
44 @@ -1243,12 +1238,7 @@ static int mtk_thermal_probe(struct plat
45 return -ENODEV;
46 }
47
48 - apmixed_base = devm_of_iomap(&pdev->dev, apmixedsys, 0, NULL);
49 - if (IS_ERR(apmixed_base)) {
50 - of_node_put(apmixedsys);
51 - return PTR_ERR(apmixed_base);
52 - }
53 -
54 + apmixed_base = of_iomap(apmixedsys, 0);
55 apmixed_phys_base = of_get_phys_base(apmixedsys);
56
57 of_node_put(apmixedsys);