diff mbox series

[v8,13/13] sqaush! max9286: Remove poc_enabled workaround

Message ID 20200409121202.11130-14-kieran.bingham+renesas@ideasonboard.com (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series max9286 v8 - modifications | expand

Commit Message

Kieran Bingham April 9, 2020, 12:12 p.m. UTC
This boolean is a flag used to handle the regulator when our
multi-max9286 workaround is in place.  It shouldn't be in the upstream
driver, and is moved out.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---
 drivers/media/i2c/max9286.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Jacopo Mondi April 9, 2020, 4:33 p.m. UTC | #1
Hi Kieran,

On Thu, Apr 09, 2020 at 01:12:02PM +0100, Kieran Bingham wrote:
> This boolean is a flag used to handle the regulator when our
> multi-max9286 workaround is in place.  It shouldn't be in the upstream
> driver, and is moved out.
>

For this and all the other patches where I didn't have comments on,
please consider Acked-by: Jacopo Mondi <jacopo@jmondi.org> and feel
free to squash!

Thanks, this is looking much better now!


> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> ---
>  drivers/media/i2c/max9286.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
> index 6f114756a1e2..022f4cfaf294 100644
> --- a/drivers/media/i2c/max9286.c
> +++ b/drivers/media/i2c/max9286.c
> @@ -152,7 +152,6 @@ struct max9286_priv {
>  	struct v4l2_subdev sd;
>  	struct media_pad pads[MAX9286_N_PADS];
>  	struct regulator *regulator;
> -	bool poc_enabled;
>
>  	struct gpio_chip gpio;
>  	u8 gpio_state;
> @@ -1066,8 +1065,6 @@ static int max9286_init(struct device *dev)
>  		return ret;
>  	}
>
> -	priv->poc_enabled = true;
> -
>  	ret = max9286_setup(priv);
>  	if (ret) {
>  		dev_err(dev, "Unable to setup max9286\n");
> @@ -1099,7 +1096,6 @@ static int max9286_init(struct device *dev)
>  	max9286_v4l2_unregister(priv);
>  err_regulator:
>  	regulator_disable(priv->regulator);
> -	priv->poc_enabled = false;
>
>  	return ret;
>  }
> @@ -1324,8 +1320,7 @@ static int max9286_remove(struct i2c_client *client)
>
>  	max9286_v4l2_unregister(priv);
>
> -	if (priv->poc_enabled)
> -		regulator_disable(priv->regulator);
> +	regulator_disable(priv->regulator);
>  	regulator_put(priv->regulator);
>
>  	gpiod_set_value_cansleep(priv->gpiod_pwdn, 0);
> --
> 2.20.1
>
diff mbox series

Patch

diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index 6f114756a1e2..022f4cfaf294 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -152,7 +152,6 @@  struct max9286_priv {
 	struct v4l2_subdev sd;
 	struct media_pad pads[MAX9286_N_PADS];
 	struct regulator *regulator;
-	bool poc_enabled;
 
 	struct gpio_chip gpio;
 	u8 gpio_state;
@@ -1066,8 +1065,6 @@  static int max9286_init(struct device *dev)
 		return ret;
 	}
 
-	priv->poc_enabled = true;
-
 	ret = max9286_setup(priv);
 	if (ret) {
 		dev_err(dev, "Unable to setup max9286\n");
@@ -1099,7 +1096,6 @@  static int max9286_init(struct device *dev)
 	max9286_v4l2_unregister(priv);
 err_regulator:
 	regulator_disable(priv->regulator);
-	priv->poc_enabled = false;
 
 	return ret;
 }
@@ -1324,8 +1320,7 @@  static int max9286_remove(struct i2c_client *client)
 
 	max9286_v4l2_unregister(priv);
 
-	if (priv->poc_enabled)
-		regulator_disable(priv->regulator);
+	regulator_disable(priv->regulator);
 	regulator_put(priv->regulator);
 
 	gpiod_set_value_cansleep(priv->gpiod_pwdn, 0);