diff mbox series

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

Message ID 20220510134146.1727701-1-zheyuma97@gmail.com
State Accepted
Commit 31b980c06900796070cbbe036483aca4acbdc04f
Headers show
Series media: TDA1997x: Fix the error handling in tda1997x_probe() | expand

Commit Message

Zheyu Ma May 10, 2022, 1:41 p.m. UTC
The driver should disable the regulator when failing to probe.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
 drivers/media/i2c/tda1997x.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Tim Harvey May 13, 2022, 3:35 p.m. UTC | #1
On Tue, May 10, 2022 at 6:42 AM Zheyu Ma <zheyuma97@gmail.com> wrote:
>
> The driver should disable the regulator when failing to probe.
>
> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
> ---
>  drivers/media/i2c/tda1997x.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
> index 8fafce26d62f..0de7acdf58a7 100644
> --- a/drivers/media/i2c/tda1997x.c
> +++ b/drivers/media/i2c/tda1997x.c
> @@ -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);
> --
> 2.25.1
>

Acked-By: Tim Harvey <tharvey@gateworks.com>

Best Regards,

Tim
diff mbox series

Patch

diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
index 8fafce26d62f..0de7acdf58a7 100644
--- a/drivers/media/i2c/tda1997x.c
+++ b/drivers/media/i2c/tda1997x.c
@@ -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);