summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/mediatek
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-19 17:32:31 +0100
committerDaniel Lezcano <daniel.lezcano@linaro.org>2023-04-26 10:38:34 +0200
commitf0fb67c27160eb1aed1524cf5bf7dbbc3174f1b9 (patch)
tree07ae9d6f0614ba680a503792b6bcba3939b57eb4 /drivers/thermal/mediatek
parentthermal/drivers/mediatek: Change clk_prepare_enable to devm_clk_get_enabled i... (diff)
downloadlinux-f0fb67c27160eb1aed1524cf5bf7dbbc3174f1b9.tar.xz
linux-f0fb67c27160eb1aed1524cf5bf7dbbc3174f1b9.zip
thermal/drivers/mediatek: Use of_address_to_resource()
Replace of_get_address() and of_translate_address() calls with single call to of_address_to_resource(). Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20230319163231.226738-1-robh@kernel.org
Diffstat (limited to 'drivers/thermal/mediatek')
-rw-r--r--drivers/thermal/mediatek/auxadc_thermal.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c
index b59fe4307b0a..0b5528804bbd 100644
--- a/drivers/thermal/mediatek/auxadc_thermal.c
+++ b/drivers/thermal/mediatek/auxadc_thermal.c
@@ -979,14 +979,12 @@ static void mtk_thermal_init_bank(struct mtk_thermal *mt, int num,
static u64 of_get_phys_base(struct device_node *np)
{
- u64 size64;
- const __be32 *regaddr_p;
+ struct resource res;
- regaddr_p = of_get_address(np, 0, &size64, NULL);
- if (!regaddr_p)
+ if (of_address_to_resource(np, 0, &res))
return OF_BAD_ADDR;
- return of_translate_address(np, regaddr_p);
+ return res.start;
}
static int mtk_thermal_extract_efuse_v1(struct mtk_thermal *mt, u32 *buf)