Skip to content

Commit 072ce91

Browse files
lategoodbyebebarino
authored andcommitted
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>
1 parent 8f5ae30 commit 072ce91

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

drivers/clk/bcm/clk-raspberrypi.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,11 @@ static int raspberrypi_fw_is_prepared(struct clk_hw *hw)
194194

195195
ret = raspberrypi_clock_property(rpi->firmware, data,
196196
RPI_FIRMWARE_GET_CLOCK_STATE, &val);
197-
if (ret)
197+
if (ret) {
198+
dev_err_ratelimited(rpi->dev, "Failed to get %s state: %d\n",
199+
clk_hw_get_name(hw), ret);
198200
return 0;
201+
}
199202

200203
return !!(val & RPI_FIRMWARE_STATE_ENABLE_BIT);
201204
}
@@ -211,8 +214,11 @@ static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
211214

212215
ret = raspberrypi_clock_property(rpi->firmware, data,
213216
RPI_FIRMWARE_GET_CLOCK_RATE, &val);
214-
if (ret)
217+
if (ret) {
218+
dev_err_ratelimited(rpi->dev, "Failed to get %s frequency: %d\n",
219+
clk_hw_get_name(hw), ret);
215220
return 0;
221+
}
216222

217223
return val;
218224
}

0 commit comments

Comments
 (0)