mtd: rawnand: atmel: switch to using devm_fwnode_gpiod_get()
Subsystems (4)
PATCH 1/1 mtd: rawnand: atmel: switch to using devm_fwnode_gpiod_get()
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().
--- drivers/mtd/nand/raw/atmel/nand-controller.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/mtd/nand/raw/atmel/nand-controller.c +10 -10
@@ -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",
Signature · 5 lines
2.24.1.735.g03f4e72817-goog -- Dmitry
Alexandre Belloni
maintainerHi,
Quoted 13 lines · Dmitry Torokhov
devm_fwnode_get_index_gpiod_from_child()is going away as the name is too unwieldy, let's switch to using the newdevm_fwnode_gpiod_get().Signed-off-by Dmitry Torokhov <[email protected]>--- drivers/mtd/nand/raw/atmel/nand-controller.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)drivers/mtd/nand/raw/atmel/nand-controller.c +0
-0
drivers/mtd/nand/raw/atmel/nand-controller.c static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc, · line 1581
Quoted 7 lines
drivers/mtd/nand/raw/atmel/nand-controller.c +1
-3@@ -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)?
Quoted 39 lines
drivers/mtd/nand/raw/atmel/nand-controller.c +9
-7+ "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",Signature · 5 lines
2.24.1.735.g03f4e72817-goog -- Dmitry
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi Alexandre,
Quoted 17 lines · Alexandre Belloni
Hi,
Quoted 14 lines · Dmitry Torokhov
devm_fwnode_get_index_gpiod_from_child()is going away as the name is too unwieldy, let's switch to using the newdevm_fwnode_gpiod_get().Signed-off-by Dmitry Torokhov <[email protected]>--- drivers/mtd/nand/raw/atmel/nand-controller.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)drivers/mtd/nand/raw/atmel/nand-controller.c +0
-0@@ -1578,9 +1578,8 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
Quoted 8 lines
drivers/mtd/nand/raw/atmel/nand-controller.c static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc, · line 1581
Quoted 6 lines
drivers/mtd/nand/raw/atmel/nand-controller.c +1
-3nand->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.
Signature · 1 line
Dmitry