Skip to contentSkip to conversation

media: i2c: ds90ub9x3: Remove unneeded of_gpio_n_cells assignment

PATCH In review Andy Shevchenko 3 participants 5 messages Mar 31, 2025 – May 5, 2025

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

PATCH 1/1 media: i2c: ds90ub9x3: Remove unneeded of_gpio_n_cells assignment

The default for of_gpio_n_cells is 2, no need to assign the same in the user.

---
 drivers/media/i2c/ds90ub913.c | 1 -
 drivers/media/i2c/ds90ub953.c | 1 -
 2 files changed, 2 deletions(-)
drivers/media/i2c/ds90ub913.c +0 -1
index fd2d2d5272bf..834df8d508e6 100644
@@ -216,7 +216,6 @@ static int ub913_gpiochip_probe(struct ub913_data *priv)
 	gc->direction_output = ub913_gpio_direction_out;
 	gc->set = ub913_gpio_set;
 	gc->of_xlate = ub913_gpio_of_xlate;
-	gc->of_gpio_n_cells = 2;
 
 	ret = gpiochip_add_data(gc, priv);
 	if (ret) {
drivers/media/i2c/ds90ub953.c +0 -1
index 46569381b332..1cd5ac7157e4 100644
@@ -420,7 +420,6 @@ static int ub953_gpiochip_probe(struct ub953_data *priv)
 	gc->get = ub953_gpio_get;
 	gc->set = ub953_gpio_set;
 	gc->of_xlate = ub953_gpio_of_xlate;
-	gc->of_gpio_n_cells = 2;
 
 	ret = gpiochip_add_data(gc, priv);
 	if (ret) {
Signature · 1 line
2.47.2
maintainer
#1 lore raw

Hi,

Quoted 2 lines · Andy Shevchenko

The default for of_gpio_n_cells is 2, no need to assign the same in the user.

Where is this documented? I'm also having trouble finding the implementation.

Tomi

Quoted 30 lines
---
  drivers/media/i2c/ds90ub913.c | 1 -
  drivers/media/i2c/ds90ub953.c | 1 -
  2 files changed, 2 deletions(-)
drivers/media/i2c/ds90ub913.c +0 -1
index fd2d2d5272bf..834df8d508e6 100644
@@ -216,7 +216,6 @@ static int ub913_gpiochip_probe(struct ub913_data *priv)
  	gc->direction_output = ub913_gpio_direction_out;
  	gc->set = ub913_gpio_set;
  	gc->of_xlate = ub913_gpio_of_xlate;
-	gc->of_gpio_n_cells = 2;
 
  	ret = gpiochip_add_data(gc, priv);
  	if (ret) {
drivers/media/i2c/ds90ub953.c +0 -1
index 46569381b332..1cd5ac7157e4 100644
@@ -420,7 +420,6 @@ static int ub953_gpiochip_probe(struct ub953_data *priv)
  	gc->get = ub953_gpio_get;
  	gc->set = ub953_gpio_set;
  	gc->of_xlate = ub953_gpio_of_xlate;
-	gc->of_gpio_n_cells = 2;
 
  	ret = gpiochip_add_data(gc, priv);
  	if (ret) {
#2 lore raw
Quoted 6 lines · Tomi Valkeinen
Quoted 2 lines · Andy Shevchenko

The default for of_gpio_n_cells is 2, no need to assign the same in the user.

Where is this documented? I'm also having trouble finding the implementation.

The idea was introduced back in 391c970c0dd1 ("of/gpio: add default of_xlate function if device has a node pointer"). But now I realised that it was never assumed that default is 2 for the cases when the ->of_xlate() explicitly provided. So, this is wrong patch, thanks for the review!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw

Hi Andy, Tomi,

Quoted 5 lines · Andy Shevchenko
Quoted 4 lines · Tomi Valkeinen
Quoted 2 lines · Andy Shevchenko

The default for of_gpio_n_cells is 2, no need to assign the same in the user.

Quoted 7 lines
Quoted 2 lines

Where is this documented? I'm also having trouble finding the implementation.

The idea was introduced back in 391c970c0dd1 ("of/gpio: add default of_xlate function if device has a node pointer"). But now I realised that it was never assumed that default is 2 for the cases when the ->of_xlate() explicitly provided. So, this is wrong patch, thanks for the review!

Does the same conclusion apply to the similar max96717 patch as well?

Signature · 1 line
Sakari Ailus
#4 lore raw
Quoted 9 lines · Sakari Ailus
Quoted 8 lines · Andy Shevchenko
Quoted 6 lines · Tomi Valkeinen
Quoted 2 lines · Andy Shevchenko

The default for of_gpio_n_cells is 2, no need to assign the same in the user.

Where is this documented? I'm also having trouble finding the implementation.

Quoted 6 lines
Quoted 4 lines

The idea was introduced back in 391c970c0dd1 ("of/gpio: add default of_xlate function if device has a node pointer"). But now I realised that it was never assumed that default is 2 for the cases when the ->of_xlate() explicitly provided. So, this is wrong patch, thanks for the review!

Does the same conclusion apply to the similar max96717 patch as well?

If you are referring to [email protected] (and why not replying there?), then no, that change is correct.

Signature · 2 lines
With Best Regards,
Andy Shevchenko