diff mbox series

[v1,1/1] media: i2c: max9286: Get rid of duplicate of_node assignment

Message ID 20211202210335.78015-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [v1,1/1] media: i2c: max9286: Get rid of duplicate of_node assignment | expand

Commit Message

Andy Shevchenko Dec. 2, 2021, 9:03 p.m. UTC
GPIO library does copy the of_node from the parent device of
the GPIO chip, there is no need to repeat this in the individual
drivers. Remove assignment here.

For the details one may look into the of_gpio_dev_init() implementation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/media/i2c/max9286.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Laurent Pinchart Dec. 2, 2021, 9:35 p.m. UTC | #1
Hi Andy,

Thank you for the patch.

On Thu, Dec 02, 2021 at 11:03:35PM +0200, Andy Shevchenko wrote:
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove assignment here.
> 
> For the details one may look into the of_gpio_dev_init() implementation.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/i2c/max9286.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
> index 7c663fd587bb..a662d3aa0641 100644
> --- a/drivers/media/i2c/max9286.c
> +++ b/drivers/media/i2c/max9286.c
> @@ -1055,7 +1055,6 @@ static int max9286_register_gpio(struct max9286_priv *priv)
>  	gpio->label = dev_name(dev);
>  	gpio->parent = dev;
>  	gpio->owner = THIS_MODULE;
> -	gpio->of_node = dev->of_node;
>  	gpio->ngpio = 2;
>  	gpio->base = -1;
>  	gpio->set = max9286_gpio_set;
Kieran Bingham Dec. 3, 2021, 1:09 p.m. UTC | #2
Quoting Andy Shevchenko (2021-12-02 21:03:35)
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove assignment here.
> 
> For the details one may look into the of_gpio_dev_init() implementation.

I see it.

Thanks,

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/media/i2c/max9286.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
> index 7c663fd587bb..a662d3aa0641 100644
> --- a/drivers/media/i2c/max9286.c
> +++ b/drivers/media/i2c/max9286.c
> @@ -1055,7 +1055,6 @@ static int max9286_register_gpio(struct max9286_priv *priv)
>         gpio->label = dev_name(dev);
>         gpio->parent = dev;
>         gpio->owner = THIS_MODULE;
> -       gpio->of_node = dev->of_node;
>         gpio->ngpio = 2;
>         gpio->base = -1;
>         gpio->set = max9286_gpio_set;
> -- 
> 2.33.0
>
diff mbox series

Patch

diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index 7c663fd587bb..a662d3aa0641 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -1055,7 +1055,6 @@  static int max9286_register_gpio(struct max9286_priv *priv)
 	gpio->label = dev_name(dev);
 	gpio->parent = dev;
 	gpio->owner = THIS_MODULE;
-	gpio->of_node = dev->of_node;
 	gpio->ngpio = 2;
 	gpio->base = -1;
 	gpio->set = max9286_gpio_set;