* [PATCH] clk: raspberrypi: Handle cpufreq device registration failure
@ 2026-09-18 4:41 Triet Hoang
2026-09-18 13:33 ` Stefan Wahren
0 siblings, 1 reply; 2+ messages in thread
From: Triet Hoang @ 2026-09-18 4:41 UTC (permalink / raw)
To: sboyd
Cc: bmasney+clk, jbrunet+clk, florian.fainelli,
bcm-kernel-feedback-list, mcanal, wahrenst, triet.hoang.dev,
linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel
Check the return value of platform_device_register_data() when
registering the raspberrypi-cpufreq device and propagate the error
if registration fails.
This prevents the clock driver from reporting a successful probe
when the cpufreq device could not be registered.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/clk/bcm/clk-raspberrypi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
index f1a99de6de4f..9882f243d681 100644
--- a/drivers/clk/bcm/clk-raspberrypi.c
+++ b/drivers/clk/bcm/clk-raspberrypi.c
@@ -553,6 +553,8 @@ static int raspberrypi_clk_probe(struct platform_device *pdev)
rpi->cpufreq = platform_device_register_data(dev, "raspberrypi-cpufreq",
-1, NULL, 0);
+ if (IS_ERR(rpi->cpufreq))
+ return PTR_ERR(rpi->cpufreq);
return 0;
}
--
2.53.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] clk: raspberrypi: Handle cpufreq device registration failure
2026-09-18 4:41 [PATCH] clk: raspberrypi: Handle cpufreq device registration failure Triet Hoang
@ 2026-09-18 13:33 ` Stefan Wahren
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Wahren @ 2026-09-18 13:33 UTC (permalink / raw)
To: Triet Hoang, sboyd
Cc: bmasney+clk, jbrunet+clk, florian.fainelli,
bcm-kernel-feedback-list, mcanal, linux-clk, linux-rpi-kernel,
linux-arm-kernel, linux-kernel
Hi Triet,
nice catch.
Am 18.09.26 um 06:41 schrieb Triet Hoang:
> Check the return value of platform_device_register_data() when
> registering the raspberrypi-cpufreq device and propagate the error
> if registration fails.
>
> This prevents the clock driver from reporting a successful probe
> when the cpufreq device could not be registered.
>
> Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Could you please add a Fixes tag?
Also it would be nice, if you can send a patch which also fixes
drivers/firmware/raspberrypi.c
Thanks
> ---
> drivers/clk/bcm/clk-raspberrypi.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
> index f1a99de6de4f..9882f243d681 100644
> --- a/drivers/clk/bcm/clk-raspberrypi.c
> +++ b/drivers/clk/bcm/clk-raspberrypi.c
> @@ -553,6 +553,8 @@ static int raspberrypi_clk_probe(struct platform_device *pdev)
>
> rpi->cpufreq = platform_device_register_data(dev, "raspberrypi-cpufreq",
> -1, NULL, 0);
> + if (IS_ERR(rpi->cpufreq))
> + return PTR_ERR(rpi->cpufreq);
>
> return 0;
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-18 13:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-18 4:41 [PATCH] clk: raspberrypi: Handle cpufreq device registration failure Triet Hoang
2026-09-18 13:33 ` Stefan Wahren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®