* [PATCH] thermal: mediatek: Use of_address_to_resource()
@ 2023-03-19 16:32 Rob Herring
2023-03-20 9:19 ` AngeloGioacchino Del Regno
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Rob Herring @ 2023-03-19 16:32 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-pm, linux-kernel, linux-arm-kernel, linux-mediatek
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>
---
drivers/thermal/mediatek/auxadc_thermal.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c
index ab730f9552d0..c8a3acaf56c1 100644
--- a/drivers/thermal/mediatek/auxadc_thermal.c
+++ b/drivers/thermal/mediatek/auxadc_thermal.c
@@ -897,14 +897,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)
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: mediatek: Use of_address_to_resource()
2023-03-19 16:32 [PATCH] thermal: mediatek: Use of_address_to_resource() Rob Herring
@ 2023-03-20 9:19 ` AngeloGioacchino Del Regno
2023-04-18 16:28 ` Rob Herring
2023-04-19 7:40 ` Daniel Lezcano
2 siblings, 0 replies; 4+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-03-20 9:19 UTC (permalink / raw)
To: Rob Herring, Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria,
Zhang Rui, Matthias Brugger
Cc: linux-pm, linux-kernel, linux-arm-kernel, linux-mediatek
Il 19/03/23 17:32, Rob Herring ha scritto:
> 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>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: mediatek: Use of_address_to_resource()
2023-03-19 16:32 [PATCH] thermal: mediatek: Use of_address_to_resource() Rob Herring
2023-03-20 9:19 ` AngeloGioacchino Del Regno
@ 2023-04-18 16:28 ` Rob Herring
2023-04-19 7:40 ` Daniel Lezcano
2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2023-04-18 16:28 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-pm, linux-kernel, linux-arm-kernel, linux-mediatek
On Sun, Mar 19, 2023 at 11:32:31AM -0500, Rob Herring wrote:
> 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>
> ---
> drivers/thermal/mediatek/auxadc_thermal.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
Ping!
>
> diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c
> index ab730f9552d0..c8a3acaf56c1 100644
> --- a/drivers/thermal/mediatek/auxadc_thermal.c
> +++ b/drivers/thermal/mediatek/auxadc_thermal.c
> @@ -897,14 +897,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)
> --
> 2.39.2
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: mediatek: Use of_address_to_resource()
2023-03-19 16:32 [PATCH] thermal: mediatek: Use of_address_to_resource() Rob Herring
2023-03-20 9:19 ` AngeloGioacchino Del Regno
2023-04-18 16:28 ` Rob Herring
@ 2023-04-19 7:40 ` Daniel Lezcano
2 siblings, 0 replies; 4+ messages in thread
From: Daniel Lezcano @ 2023-04-19 7:40 UTC (permalink / raw)
To: Rob Herring, Rafael J. Wysocki, Amit Kucheria, Zhang Rui,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-pm, linux-kernel, linux-arm-kernel, linux-mediatek
On 19/03/2023 17:32, Rob Herring wrote:
> 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>
> ---
Applied, thanks
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-19 7:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-19 16:32 [PATCH] thermal: mediatek: Use of_address_to_resource() Rob Herring
2023-03-20 9:19 ` AngeloGioacchino Del Regno
2023-04-18 16:28 ` Rob Herring
2023-04-19 7:40 ` Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).