Skip to contentSkip to conversation

media: i2c: max9286: Get rid of duplicate of_node assignment

PATCH In review Andy Shevchenko 3 participants 3 messages Dec 2, 2021 – Dec 3, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: i2c: max9286: Get rid of duplicate of_node assignment

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.

---
 drivers/media/i2c/max9286.c | 1 -
 1 file changed, 1 deletion(-)
drivers/media/i2c/max9286.c +0 -1
index 7c663fd587bb..a662d3aa0641 100644
@@ -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;
Signature · 1 line
2.33.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Andy,

Thank you for the patch.

Quoted 7 lines · Andy Shevchenko

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.

Quoted 16 lines
---
 drivers/media/i2c/max9286.c | 1 -
 1 file changed, 1 deletion(-)
drivers/media/i2c/max9286.c +0 -1
index 7c663fd587bb..a662d3aa0641 100644
@@ -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;
Signature · 3 lines
Regards,

Laurent Pinchart
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Andy Shevchenko

Quoting Andy Shevchenko (2021-12-02 21:03:35)

Quoted 5 lines

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,

Quoted 21 lines
---
 drivers/media/i2c/max9286.c | 1 -
 1 file changed, 1 deletion(-)
drivers/media/i2c/max9286.c +0 -1
index 7c663fd587bb..a662d3aa0641 100644
@@ -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;
Signature · 1 line
2.33.0