mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 02:53:36 +02:00
clk: bcm: rpi: Add missing logs if firmware fails
In contrary to raspberrypi_fw_set_rate(), the ops for is_prepared() and recalc_rate() silently ignore firmware errors by just returning 0. Since these operations should never fail, add at least error logs to inform the user. Signed-off-by: Stefan Wahren <wahrenst@gmx.net> Signed-off-by: Maíra Canal <mcanal@igalia.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
8f5ae30d69
commit
072ce917bf
|
|
@ -194,8 +194,11 @@ static int raspberrypi_fw_is_prepared(struct clk_hw *hw)
|
|||
|
||||
ret = raspberrypi_clock_property(rpi->firmware, data,
|
||||
RPI_FIRMWARE_GET_CLOCK_STATE, &val);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
dev_err_ratelimited(rpi->dev, "Failed to get %s state: %d\n",
|
||||
clk_hw_get_name(hw), ret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return !!(val & RPI_FIRMWARE_STATE_ENABLE_BIT);
|
||||
}
|
||||
|
|
@ -211,8 +214,11 @@ static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
|
|||
|
||||
ret = raspberrypi_clock_property(rpi->firmware, data,
|
||||
RPI_FIRMWARE_GET_CLOCK_RATE, &val);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
dev_err_ratelimited(rpi->dev, "Failed to get %s frequency: %d\n",
|
||||
clk_hw_get_name(hw), ret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user