Skip to contentSkip to conversation

media: TDA1997x: Fix the error handling in tda1997x_probe()

PATCH In review Zheyu Ma 2 participants 2 messages May 10, 2022 – May 13, 2022

Subsystems (2)
lore
Share & tools
lore

Zheyu Ma

author
#0 lore raw

PATCH 1/1 media: TDA1997x: Fix the error handling in tda1997x_probe()

The driver should disable the regulator when failing to probe.

---
 drivers/media/i2c/tda1997x.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/i2c/tda1997x.c +1 -0
index 8fafce26d62f..0de7acdf58a7 100644
@@ -2798,6 +2798,7 @@ static int tda1997x_probe(struct i2c_client *client,
 	cancel_delayed_work(&state->delayed_work_enable_hpd);
 	mutex_destroy(&state->page_lock);
 	mutex_destroy(&state->lock);
+	tda1997x_set_power(state, 0);
 err_free_state:
 	kfree(state);
 	dev_err(&client->dev, "%s failed: %d\n", __func__, ret);
Signature · 1 line
2.25.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines · Zheyu Ma

The driver should disable the regulator when failing to probe.

---
 drivers/media/i2c/tda1997x.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/i2c/tda1997x.c +1 -1
index 8fafce26d62f..0de7acdf58a7 100644
@@ -2798,6 +2798,7 @@ static int tda1997x_probe(struct i2c_client *client,
        cancel_delayed_work(&state->delayed_work_enable_hpd);
        mutex_destroy(&state->page_lock);
        mutex_destroy(&state->lock);
+       tda1997x_set_power(state, 0);
 err_free_state:
        kfree(state);
        dev_err(&client->dev, "%s failed: %d\n", __func__, ret);
--
Quoted 2 lines

2.25.1

Best Regards,

Tim