Skip to content

Commit 35f73cc

Browse files
lategoodbyebebarino
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: 4e85e53 ("clk: bcm283x: add driver interfacing with Raspberry Pi's firmware") Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 4b59206 commit 35f73cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)