Skip to content

Commit 35f73cc

Browse files
Stefan Wahrenbebarino
authored andcommitted
clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate
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> Link: https://lore.kernel.org/r/20220625083643.4012-1-stefan.wahren@i2se.com Fixes: 4e85e53 ("clk: bcm283x: add driver interfacing with Raspberry Pi's firmware") Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 4b59206 commit 35f73cc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/clk/bcm/clk-raspberrypi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
203203
ret = raspberrypi_clock_property(rpi->firmware, data,
204204
RPI_FIRMWARE_GET_CLOCK_RATE, &val);
205205
if (ret)
206-
return ret;
206+
return 0;
207207

208208
return val;
209209
}

0 commit comments

Comments
 (0)