* [PATCH] clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate
@ 2022-06-25 8:36 Stefan Wahren
2022-06-27 16:24 ` Florian Fainelli
2022-08-23 2:17 ` Stephen Boyd
0 siblings, 2 replies; 4+ messages in thread
From: Stefan Wahren @ 2022-06-25 8:36 UTC (permalink / raw)
To: Florian Fainelli, Michael Turquette, Stephen Boyd
Cc: bcm-kernel-feedback-list, Maxime Ripard, linux-clk,
linux-arm-kernel, linux-kernel, Stefan Wahren
The function raspberrypi_fw_get_rate (e.g. used for the recalc_rate
hook) can fail to get the clock rate from the firmware. In this case
we cannot return a signed error value, which would be casted to
unsigned long. Fix this by returning 0 instead.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
drivers/clk/bcm/clk-raspberrypi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
index 73518009a0f2..39d63c983d62 100644
--- a/drivers/clk/bcm/clk-raspberrypi.c
+++ b/drivers/clk/bcm/clk-raspberrypi.c
@@ -203,7 +203,7 @@ static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
ret = raspberrypi_clock_property(rpi->firmware, data,
RPI_FIRMWARE_GET_CLOCK_RATE, &val);
if (ret)
- return ret;
+ return 0;
return val;
}
--
2.25.1
_______________________________________________
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] clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate
2022-06-25 8:36 [PATCH] clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate Stefan Wahren
@ 2022-06-27 16:24 ` Florian Fainelli
2022-08-05 8:32 ` Stefan Wahren
2022-08-23 2:17 ` Stephen Boyd
1 sibling, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2022-06-27 16:24 UTC (permalink / raw)
To: Stefan Wahren, Florian Fainelli, Michael Turquette, Stephen Boyd
Cc: bcm-kernel-feedback-list, Maxime Ripard, linux-clk,
linux-arm-kernel, linux-kernel
On 6/25/22 01:36, Stefan Wahren wrote:
> The function raspberrypi_fw_get_rate (e.g. used for the recalc_rate
> hook) can fail to get the clock rate from the firmware. In this case
> we cannot return a signed error value, which would be casted to
> unsigned long. Fix this by returning 0 instead.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: 4e85e535e6cc ("clk: bcm283x: add driver interfacing with
Raspberry Pi's firmware")
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
_______________________________________________
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] clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate
2022-06-27 16:24 ` Florian Fainelli
@ 2022-08-05 8:32 ` Stefan Wahren
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Wahren @ 2022-08-05 8:32 UTC (permalink / raw)
To: Florian Fainelli, Michael Turquette, Stephen Boyd
Cc: bcm-kernel-feedback-list, Maxime Ripard, linux-clk,
linux-arm-kernel, linux-kernel
Am 27.06.22 um 18:24 schrieb Florian Fainelli:
> On 6/25/22 01:36, Stefan Wahren wrote:
>> The function raspberrypi_fw_get_rate (e.g. used for the recalc_rate
>> hook) can fail to get the clock rate from the firmware. In this case
>> we cannot return a signed error value, which would be casted to
>> unsigned long. Fix this by returning 0 instead.
>>
>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>
> Fixes: 4e85e535e6cc ("clk: bcm283x: add driver interfacing with
> Raspberry Pi's firmware")
>
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
gentle ping
_______________________________________________
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] clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate
2022-06-25 8:36 [PATCH] clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate Stefan Wahren
2022-06-27 16:24 ` Florian Fainelli
@ 2022-08-23 2:17 ` Stephen Boyd
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2022-08-23 2:17 UTC (permalink / raw)
To: Florian Fainelli, Michael Turquette, Stefan Wahren
Cc: bcm-kernel-feedback-list, Maxime Ripard, linux-clk,
linux-arm-kernel, linux-kernel, Stefan Wahren
Quoting Stefan Wahren (2022-06-25 01:36:43)
> The function raspberrypi_fw_get_rate (e.g. used for the recalc_rate
> hook) can fail to get the clock rate from the firmware. In this case
> we cannot return a signed error value, which would be casted to
> unsigned long. Fix this by returning 0 instead.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> ---
Applied to clk-fixes
_______________________________________________
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:[~2022-08-23 2:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-25 8:36 [PATCH] clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate Stefan Wahren
2022-06-27 16:24 ` Florian Fainelli
2022-08-05 8:32 ` Stefan Wahren
2022-08-23 2:17 ` Stephen Boyd
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).