]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 Nov 2022 14:10:54 +0000 (15:10 +0100)
commit3343f354bc0701cf4022b48559200e8ac1d19f5d
treef63f0b89573c8c74f218d51318e7c6936a24b45c
parentf557441f2fa975b4c7948a650d3971b59246e95e
clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate

BugLink: https://bugs.launchpad.net/bugs/1991840
[ Upstream commit 35f73cca1cecda0c1f8bb7d8be4ce5cd2d46ae8c ]

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: 4e85e535e6cc ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/clk/bcm/clk-raspberrypi.c