]> git.baikalelectronics.ru Git - kernel.git/commit
clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate
authorStefan Wahren <stefan.wahren@i2se.com>
Sat, 25 Jun 2022 08:36:43 +0000 (10:36 +0200)
committerStephen Boyd <sboyd@kernel.org>
Tue, 23 Aug 2022 02:17:12 +0000 (19:17 -0700)
commitbb32ef870131b895a892a429939722f27a633701
treece47b90a5119c06c1401e342e5c36c73ff238527
parentf81559b87cf8295070eab0990263f99286ca1f10
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: 69626d8a1213 ("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>
drivers/clk/bcm/clk-raspberrypi.c