mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
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: 4e85e535e6
("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>
This commit is contained in:
parent
4b592061f7
commit
35f73cca1c
1 changed files with 1 additions and 1 deletions
|
@ -203,7 +203,7 @@ static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
|
||||||
ret = raspberrypi_clock_property(rpi->firmware, data,
|
ret = raspberrypi_clock_property(rpi->firmware, data,
|
||||||
RPI_FIRMWARE_GET_CLOCK_RATE, &val);
|
RPI_FIRMWARE_GET_CLOCK_RATE, &val);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return 0;
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue