The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v1 1/1] media: i2c: ds90ub9x3: Remove unneeded of_gpio_n_cells assignment
@ 2025-03-31  7:02 Andy Shevchenko
  2025-04-03  8:07 ` Tomi Valkeinen
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-03-31  7:02 UTC (permalink / raw)
  To: Tomi Valkeinen, linux-media, linux-kernel
  Cc: Mauro Carvalho Chehab, Andy Shevchenko

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/media/i2c/ds90ub913.c | 1 -
 drivers/media/i2c/ds90ub953.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/media/i2c/ds90ub913.c b/drivers/media/i2c/ds90ub913.c
index fd2d2d5272bf..834df8d508e6 100644
--- a/drivers/media/i2c/ds90ub913.c
+++ b/drivers/media/i2c/ds90ub913.c
@@ -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) {
diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c
index 46569381b332..1cd5ac7157e4 100644
--- a/drivers/media/i2c/ds90ub953.c
+++ b/drivers/media/i2c/ds90ub953.c
@@ -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.47.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] media: i2c: ds90ub9x3: Remove unneeded of_gpio_n_cells assignment
  2025-03-31  7:02 [PATCH v1 1/1] media: i2c: ds90ub9x3: Remove unneeded of_gpio_n_cells assignment Andy Shevchenko
@ 2025-04-03  8:07 ` Tomi Valkeinen
  2025-04-03 10:58   ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Tomi Valkeinen @ 2025-04-03  8:07 UTC (permalink / raw)
  To: Andy Shevchenko, linux-media, linux-kernel; +Cc: Mauro Carvalho Chehab

Hi,

On 31/03/2025 10:02, Andy Shevchenko wrote:
> 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

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/media/i2c/ds90ub913.c | 1 -
>   drivers/media/i2c/ds90ub953.c | 1 -
>   2 files changed, 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/ds90ub913.c b/drivers/media/i2c/ds90ub913.c
> index fd2d2d5272bf..834df8d508e6 100644
> --- a/drivers/media/i2c/ds90ub913.c
> +++ b/drivers/media/i2c/ds90ub913.c
> @@ -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) {
> diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c
> index 46569381b332..1cd5ac7157e4 100644
> --- a/drivers/media/i2c/ds90ub953.c
> +++ b/drivers/media/i2c/ds90ub953.c
> @@ -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) {


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] media: i2c: ds90ub9x3: Remove unneeded of_gpio_n_cells assignment
  2025-04-03  8:07 ` Tomi Valkeinen
@ 2025-04-03 10:58   ` Andy Shevchenko
  2025-05-05  8:17     ` Sakari Ailus
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-04-03 10:58 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-media, linux-kernel, Mauro Carvalho Chehab

On Thu, Apr 03, 2025 at 11:07:40AM +0300, Tomi Valkeinen wrote:
> On 31/03/2025 10:02, Andy Shevchenko wrote:
> > 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!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] media: i2c: ds90ub9x3: Remove unneeded of_gpio_n_cells assignment
  2025-04-03 10:58   ` Andy Shevchenko
@ 2025-05-05  8:17     ` Sakari Ailus
  2025-05-05 14:38       ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Sakari Ailus @ 2025-05-05  8:17 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Tomi Valkeinen, linux-media, linux-kernel, Mauro Carvalho Chehab

Hi Andy, Tomi,

On Thu, Apr 03, 2025 at 01:58:10PM +0300, Andy Shevchenko wrote:
> On Thu, Apr 03, 2025 at 11:07:40AM +0300, Tomi Valkeinen wrote:
> > On 31/03/2025 10:02, Andy Shevchenko wrote:
> > > 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!

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

-- 
Sakari Ailus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] media: i2c: ds90ub9x3: Remove unneeded of_gpio_n_cells assignment
  2025-05-05  8:17     ` Sakari Ailus
@ 2025-05-05 14:38       ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2025-05-05 14:38 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Tomi Valkeinen, linux-media, linux-kernel, Mauro Carvalho Chehab

On Mon, May 05, 2025 at 08:17:47AM +0000, Sakari Ailus wrote:
> On Thu, Apr 03, 2025 at 01:58:10PM +0300, Andy Shevchenko wrote:
> > On Thu, Apr 03, 2025 at 11:07:40AM +0300, Tomi Valkeinen wrote:
> > > On 31/03/2025 10:02, Andy Shevchenko wrote:
> > > > 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!
> 
> Does the same conclusion apply to the similar max96717 patch as well?

If you are referring to
20250331070152.3985520-1-andriy.shevchenko@linux.intel.com
(and why not replying there?), then no, that change is correct.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-05-05 14:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-31  7:02 [PATCH v1 1/1] media: i2c: ds90ub9x3: Remove unneeded of_gpio_n_cells assignment Andy Shevchenko
2025-04-03  8:07 ` Tomi Valkeinen
2025-04-03 10:58   ` Andy Shevchenko
2025-05-05  8:17     ` Sakari Ailus
2025-05-05 14:38       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox