fd18a5365c0ab8fd39a5ac9fe5e8f2b82c74dfae
[openwrt/staging/ansuel.git] /
1 From 655fe2533ac05323a07c19ba079bf2064e7741af Mon Sep 17 00:00:00 2001
2 From: Rob Herring <robh@kernel.org>
3 Date: Sun, 19 Mar 2023 11:32:31 -0500
4 Subject: [PATCH 20/42] thermal/drivers/mediatek: Use of_address_to_resource()
5
6 Replace of_get_address() and of_translate_address() calls with single
7 call to of_address_to_resource().
8
9 Signed-off-by: Rob Herring <robh@kernel.org>
10 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
11 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
12 Link: https://lore.kernel.org/r/20230319163231.226738-1-robh@kernel.org
13 ---
14 drivers/thermal/mediatek/auxadc_thermal.c | 8 +++-----
15 1 file changed, 3 insertions(+), 5 deletions(-)
16
17 --- a/drivers/thermal/mediatek/auxadc_thermal.c
18 +++ b/drivers/thermal/mediatek/auxadc_thermal.c
19 @@ -979,14 +979,12 @@ static void mtk_thermal_init_bank(struct
20
21 static u64 of_get_phys_base(struct device_node *np)
22 {
23 - u64 size64;
24 - const __be32 *regaddr_p;
25 + struct resource res;
26
27 - regaddr_p = of_get_address(np, 0, &size64, NULL);
28 - if (!regaddr_p)
29 + if (of_address_to_resource(np, 0, &res))
30 return OF_BAD_ADDR;
31
32 - return of_translate_address(np, regaddr_p);
33 + return res.start;
34 }
35
36 static int mtk_thermal_extract_efuse_v1(struct mtk_thermal *mt, u32 *buf)