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:
Stefan Wahren 2025-07-31 18:06:17 -03:00 committed by Stephen Boyd
parent 8f5ae30d69
commit 072ce917bf
No known key found for this signature in database
GPG Key ID: AD028897C6E49525

View File

@ -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;
}