Commit 7a95a72e authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Miquel Raynal

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().
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 9ee0f956
...@@ -1578,9 +1578,8 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc, ...@@ -1578,9 +1578,8 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
nand->numcs = numcs; nand->numcs = numcs;
gpio = devm_fwnode_get_index_gpiod_from_child(nc->dev, "det", 0, gpio = devm_fwnode_gpiod_get(nc->dev, of_fwnode_handle(np),
&np->fwnode, GPIOD_IN, "det", GPIOD_IN, "nand-det");
"nand-det");
if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) { if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) {
dev_err(nc->dev, dev_err(nc->dev,
"Failed to get detect gpio (err = %ld)\n", "Failed to get detect gpio (err = %ld)\n",
...@@ -1624,9 +1623,10 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc, ...@@ -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.type = ATMEL_NAND_NATIVE_RB;
nand->cs[i].rb.id = val; nand->cs[i].rb.id = val;
} else { } else {
gpio = devm_fwnode_get_index_gpiod_from_child(nc->dev, gpio = devm_fwnode_gpiod_get_index(nc->dev,
"rb", i, &np->fwnode, of_fwnode_handle(np),
GPIOD_IN, "nand-rb"); "rb", i, GPIOD_IN,
"nand-rb");
if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) { if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) {
dev_err(nc->dev, dev_err(nc->dev,
"Failed to get R/B gpio (err = %ld)\n", "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, ...@@ -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", gpio = devm_fwnode_gpiod_get_index(nc->dev,
i, &np->fwnode, of_fwnode_handle(np),
GPIOD_OUT_HIGH, "cs", i, GPIOD_OUT_HIGH,
"nand-cs"); "nand-cs");
if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) { if (IS_ERR(gpio) && PTR_ERR(gpio) != -ENOENT) {
dev_err(nc->dev, dev_err(nc->dev,
"Failed to get CS gpio (err = %ld)\n", "Failed to get CS gpio (err = %ld)\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment