linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: atmel: switch to using devm_fwnode_gpiod_get()
@ 2020-01-03  1:22 Dmitry Torokhov
  2020-01-03  9:07 ` Alexandre Belloni
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2020-01-03  1:22 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Nicolas Ferre, Alexandre Belloni, Ludovic Desroches,
	Boris Brezillon, linux-mtd, linux-arm-kernel, linux-kernel

devm_fwnode_get_index_gpiod_from_child() is going away as the name is
too unwieldy, let's switch to using the new devm_fwnode_gpiod_get().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/mtd/nand/raw/atmel/nand-controller.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index 8d6be90a6fe8a..849bd5f16492d 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -1578,9 +1578,8 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
 
 	nand->numcs = numcs;
 
-	gpio = devm_fwnode_get_index_gpiod_from_child(nc->dev, "det", 0,
-						      &np->fwnode, GPIOD_IN,
-						      "nand-det");
+	gpio = devm_fwnode_gpiod_get(nc->dev, of_fwnode_hanlde(np),
+				     "det", GPIOD_IN, "nand-det");
 	if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) {
 		dev_err(nc->dev,
 			"Failed to get detect gpio (err = %ld)\n",
@@ -1624,9 +1623,10 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
 			nand->cs[i].rb.type = ATMEL_NAND_NATIVE_RB;
 			nand->cs[i].rb.id = val;
 		} else {
-			gpio = devm_fwnode_get_index_gpiod_from_child(nc->dev,
-							"rb", i, &np->fwnode,
-							GPIOD_IN, "nand-rb");
+			gpio = devm_fwnode_gpiod_get_index(nc->dev,
+							   of_fwnode_handle(np),
+							   "rb", i, GPIOD_IN,
+							   "nand-rb");
 			if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) {
 				dev_err(nc->dev,
 					"Failed to get R/B gpio (err = %ld)\n",
@@ -1640,10 +1640,10 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
 			}
 		}
 
-		gpio = devm_fwnode_get_index_gpiod_from_child(nc->dev, "cs",
-							      i, &np->fwnode,
-							      GPIOD_OUT_HIGH,
-							      "nand-cs");
+		gpio = devm_fwnode_gpiod_get_index(nc->dev,
+						   of_fwnode_handle(np),
+						   "cs", i, GPIOD_OUT_HIGH,
+						   "nand-cs");
 		if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) {
 			dev_err(nc->dev,
 				"Failed to get CS gpio (err = %ld)\n",
-- 
2.24.1.735.g03f4e72817-goog


-- 
Dmitry

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

* Re: [PATCH] mtd: rawnand: atmel: switch to using devm_fwnode_gpiod_get()
  2020-01-03  1:22 [PATCH] mtd: rawnand: atmel: switch to using devm_fwnode_gpiod_get() Dmitry Torokhov
@ 2020-01-03  9:07 ` Alexandre Belloni
  2020-01-03 18:25   ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Belloni @ 2020-01-03  9:07 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Tudor Ambarus, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Nicolas Ferre, Ludovic Desroches,
	Boris Brezillon, linux-mtd, linux-arm-kernel, linux-kernel

Hi,

On 02/01/2020 17:22:38-0800, Dmitry Torokhov wrote:
> devm_fwnode_get_index_gpiod_from_child() is going away as the name is
> too unwieldy, let's switch to using the new devm_fwnode_gpiod_get().
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>  drivers/mtd/nand/raw/atmel/nand-controller.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
> index 8d6be90a6fe8a..849bd5f16492d 100644
> --- a/drivers/mtd/nand/raw/atmel/nand-controller.c
> +++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
> @@ -1578,9 +1578,8 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
>  
>  	nand->numcs = numcs;
>  
> -	gpio = devm_fwnode_get_index_gpiod_from_child(nc->dev, "det", 0,
> -						      &np->fwnode, GPIOD_IN,
> -						      "nand-det");
> +	gpio = devm_fwnode_gpiod_get(nc->dev, of_fwnode_hanlde(np),

Shouldn't that be of_fwnode_handle(np)?

> +				     "det", GPIOD_IN, "nand-det");
>  	if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) {
>  		dev_err(nc->dev,
>  			"Failed to get detect gpio (err = %ld)\n",
> @@ -1624,9 +1623,10 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
>  			nand->cs[i].rb.type = ATMEL_NAND_NATIVE_RB;
>  			nand->cs[i].rb.id = val;
>  		} else {
> -			gpio = devm_fwnode_get_index_gpiod_from_child(nc->dev,
> -							"rb", i, &np->fwnode,
> -							GPIOD_IN, "nand-rb");
> +			gpio = devm_fwnode_gpiod_get_index(nc->dev,
> +							   of_fwnode_handle(np),
> +							   "rb", i, GPIOD_IN,
> +							   "nand-rb");
>  			if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) {
>  				dev_err(nc->dev,
>  					"Failed to get R/B gpio (err = %ld)\n",
> @@ -1640,10 +1640,10 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
>  			}
>  		}
>  
> -		gpio = devm_fwnode_get_index_gpiod_from_child(nc->dev, "cs",
> -							      i, &np->fwnode,
> -							      GPIOD_OUT_HIGH,
> -							      "nand-cs");
> +		gpio = devm_fwnode_gpiod_get_index(nc->dev,
> +						   of_fwnode_handle(np),
> +						   "cs", i, GPIOD_OUT_HIGH,
> +						   "nand-cs");
>  		if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) {
>  			dev_err(nc->dev,
>  				"Failed to get CS gpio (err = %ld)\n",
> -- 
> 2.24.1.735.g03f4e72817-goog
> 
> 
> -- 
> Dmitry

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] mtd: rawnand: atmel: switch to using devm_fwnode_gpiod_get()
  2020-01-03  9:07 ` Alexandre Belloni
@ 2020-01-03 18:25   ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2020-01-03 18:25 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Tudor Ambarus, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Nicolas Ferre, Ludovic Desroches,
	Boris Brezillon, linux-mtd, linux-arm-kernel, linux-kernel

Hi Alexandre,

On Fri, Jan 03, 2020 at 10:07:04AM +0100, Alexandre Belloni wrote:
> Hi,
> 
> On 02/01/2020 17:22:38-0800, Dmitry Torokhov wrote:
> > devm_fwnode_get_index_gpiod_from_child() is going away as the name is
> > too unwieldy, let's switch to using the new devm_fwnode_gpiod_get().
> > 
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
> >  drivers/mtd/nand/raw/atmel/nand-controller.c | 20 ++++++++++----------
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
> > index 8d6be90a6fe8a..849bd5f16492d 100644
> > --- a/drivers/mtd/nand/raw/atmel/nand-controller.c
> > +++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
> > @@ -1578,9 +1578,8 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
> >  
> >  	nand->numcs = numcs;
> >  
> > -	gpio = devm_fwnode_get_index_gpiod_from_child(nc->dev, "det", 0,
> > -						      &np->fwnode, GPIOD_IN,
> > -						      "nand-det");
> > +	gpio = devm_fwnode_gpiod_get(nc->dev, of_fwnode_hanlde(np),
> 
> Shouldn't that be of_fwnode_handle(np)?

:( You are right. Apparently I did not actually enable the driver when
trying to compile this. I'll update and repost this shortly.

-- 
Dmitry

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

end of thread, other threads:[~2020-01-03 18:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-03  1:22 [PATCH] mtd: rawnand: atmel: switch to using devm_fwnode_gpiod_get() Dmitry Torokhov
2020-01-03  9:07 ` Alexandre Belloni
2020-01-03 18:25   ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).