Commit f0fb67c2 authored by Rob Herring's avatar Rob Herring Committed by Daniel Lezcano

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: default avatarRob Herring <robh@kernel.org>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230319163231.226738-1-robh@kernel.org
parent a3e9a9a5
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment