Skip to content

Commit

Permalink
media: ov7240: Fix "clk already disabled" / "already unprepared" back…
Browse files Browse the repository at this point in the history
…traces

On probe() the ov2740 code was manually setting the reset GPIO
instead of using the power_on() helper function.

This path however left out enabling the clk, which power_on() does do,
so when power_off() runs after the probe() is done (on runtime suspend)
then there are 2 ugly backtraces triggered by WARN()s in the clk-core. One
for "clk already disabled" followed by one for "clk already unprepared".

Fix this by using the power_on() helper in probe().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
jwrdegoede committed Sep 2, 2023
1 parent 5dc00ed commit b7d2fb0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/i2c/ov2740.c
Original file line number Diff line number Diff line change
Expand Up @@ -1529,8 +1529,10 @@ static int ov2740_probe(struct i2c_client *client)
ret = ov2740_parse_power(ov2740);
if (ret)
return ret;
gpiod_set_value_cansleep(ov2740->reset_gpio, 0);
msleep(20);

ret = ov2740_power_on(&client->dev);
if (ret)
return ret;
#endif

ret = ov2740_identify_module(ov2740);
Expand Down

0 comments on commit b7d2fb0

Please sign in to comment.