diff mbox series

[v5,2/4] media: i2c: imx412: Fix power_off ordering

Message ID 20220415115954.1649217-3-bryan.odonoghue@linaro.org
State Accepted
Commit 9a199694c6a1519522ec73a4571f68abe9f13d5d
Headers show
Series media: i2c: imx412: Add regulator control to imx412 | expand

Commit Message

Bryan O'Donoghue April 15, 2022, 11:59 a.m. UTC
The enable path does
- gpio
- clock

The disable path does
- gpio
- clock

Fix the order on the power-off path so that power-off and power-on have the
same ordering for clock and gpio.

Fixes: 9214e86c0cc1 ("media: i2c: Add imx412 camera sensor driver")
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/i2c/imx412.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alessandrelli, Daniele April 25, 2022, 2:43 p.m. UTC | #1
On Fri, 2022-04-15 at 12:59 +0100, Bryan O'Donoghue wrote:
> The enable path does
> - gpio
> - clock
> 
> The disable path does
> - gpio
> - clock
> 
> Fix the order on the power-off path so that power-off and power-on have
> the
> same ordering for clock and gpio.
> 
> Fixes: 9214e86c0cc1 ("media: i2c: Add imx412 camera sensor driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/i2c/imx412.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
> index e6be6b4250f5..84279a680873 100644
> --- a/drivers/media/i2c/imx412.c
> +++ b/drivers/media/i2c/imx412.c
> @@ -1040,10 +1040,10 @@ static int imx412_power_off(struct device *dev)
>         struct v4l2_subdev *sd = dev_get_drvdata(dev);
>         struct imx412 *imx412 = to_imx412(sd);
>  
> -       gpiod_set_value_cansleep(imx412->reset_gpio, 1);
> -
>         clk_disable_unprepare(imx412->inclk);
>  
> +       gpiod_set_value_cansleep(imx412->reset_gpio, 1);
> +
>         return 0;
>  }
>  

LGTM, thanks for the patch!

Reviewed-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
diff mbox series

Patch

diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
index e6be6b4250f5..84279a680873 100644
--- a/drivers/media/i2c/imx412.c
+++ b/drivers/media/i2c/imx412.c
@@ -1040,10 +1040,10 @@  static int imx412_power_off(struct device *dev)
 	struct v4l2_subdev *sd = dev_get_drvdata(dev);
 	struct imx412 *imx412 = to_imx412(sd);
 
-	gpiod_set_value_cansleep(imx412->reset_gpio, 1);
-
 	clk_disable_unprepare(imx412->inclk);
 
+	gpiod_set_value_cansleep(imx412->reset_gpio, 1);
+
 	return 0;
 }