]> Git Repo - linux.git/commitdiff
thermal/drivers/mediatek: Use of_address_to_resource()
authorRob Herring <[email protected]>
Sun, 19 Mar 2023 16:32:31 +0000 (11:32 -0500)
committerDaniel Lezcano <[email protected]>
Wed, 26 Apr 2023 08:38:34 +0000 (10:38 +0200)
Replace of_get_address() and of_translate_address() calls with single
call to of_address_to_resource().

Signed-off-by: Rob Herring <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
drivers/thermal/mediatek/auxadc_thermal.c

index b59fe4307b0a076f35608187bf16a91b932538f3..0b5528804bbd6daa6c53a046120af7577935531b 100644 (file)
@@ -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)
This page took 0.059743 seconds and 4 git commands to generate.