mtd: nand: raw: atmel: Access device ofnode through functions
Subsystems (4)
PATCH 1/1 mtd: nand: raw: atmel: Access device ofnode through functions
According to commit 84a42ae36683 ("dm: core: Rename device node to indicate it is private")
node_ should not be aaccess outside driver model.
Signed-off-by Andy Yan <[email protected]>
---
drivers/mtd/nand/raw/atmel/nand-controller.c | 18 +++++++++--------- drivers/mtd/nand/raw/atmel/pmecc.c | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-)
drivers/mtd/nand/raw/atmel/nand-controller.c +9 -9
@@ -1010,10 +1010,10 @@ static int atmel_nand_pmecc_init(struct nand_chip *chip)if (nc->caps->legacy_of_bindings) {u32 val; -if (!ofnode_read_u32 (nc->dev->node_,"atmel,pmecc-cap" , &val)) +if (!ofnode_read_u32 (dev_ofnode (nc->dev),"atmel,pmecc-cap" , &val)) chip->ecc.strength = val; -if (!ofnode_read_u32 (nc->dev->node_, +if (!ofnode_read_u32 (dev_ofnode (nc->dev),"atmel,pmecc-sector-size" , &val)) chip->ecc.size = val;
@@ -1671,7 +1671,7 @@ static int atmel_nand_controller_add_nands(struct atmel_nand_controller *nc)* Add support for legacy nands */ - np = nc->dev->node_; + np =dev_ofnode (nc->dev); ret =ofnode_read_u32 (np,"#address-cells" , &val);if (ret) {
@@ -1791,7 +1791,7 @@ static int atmel_nand_attach_chip(struct nand_chip *chip)if (ret)return ret; -if (nc->caps->legacy_of_bindings || !ofnode_valid (nc->dev->node_)) { +if (nc->caps->legacy_of_bindings || !ofnode_valid (dev_ofnode (nc->dev))) {/* * We keep the MTD name unchanged to avoid breaking platforms * where the MTD cmdline parser is used and the bootloader
@@ -1855,7 +1855,7 @@ atmel_nand_controller_init(struct atmel_nand_controller *nc,return PTR_ERR (nc->mck); } - ret =ofnode_parse_phandle_with_args (dev->parent->node_, + ret =ofnode_parse_phandle_with_args (dev_ofnode (dev->parent),"atmel,smc" ,NULL ,0 ,0 , &args);if (ret) {dev_err (dev,"Missing or invalid atmel,smc property\n" );
@@ -1887,7 +1887,7 @@ atmel_smc_nand_controller_init(struct atmel_smc_nand_controller *nc)if (nc->base.caps->legacy_of_bindings)return 0 ; - ret =ofnode_parse_phandle_with_args (dev->parent->node_, + ret =ofnode_parse_phandle_with_args (dev_ofnode (dev->parent), nc->base.caps->ebi_csa_regmap_name,NULL ,0 ,0 , &args);if (ret) {
@@ -1933,7 +1933,7 @@ static int atmel_hsmc_nand_controller_init(struct atmel_hsmc_nand_controller *ncint ret;u32 addr; - ret =ofnode_parse_phandle_with_args (dev->parent->node_, + ret =ofnode_parse_phandle_with_args (dev_ofnode (dev->parent),"atmel,smc" ,NULL ,0 ,0 , &args);if (ret) {dev_err (dev,"Missing or invalid atmel,smc property\n" );
@@ -1957,7 +1957,7 @@ static int atmel_hsmc_nand_controller_init(struct atmel_hsmc_nand_controller *ncif (ret)return ret; - ret =ofnode_parse_phandle_with_args (dev->node_, + ret =ofnode_parse_phandle_with_args (dev_ofnode (dev),"atmel,nfc-io" ,NULL ,0 ,0 , &args);if (ret) {dev_err (dev,"Missing or invalid atmel,nfc-io property\n" );
@@ -1971,7 +1971,7 @@ static int atmel_hsmc_nand_controller_init(struct atmel_hsmc_nand_controller *ncreturn ret; } - ret =ofnode_parse_phandle_with_args (dev->node_, + ret =ofnode_parse_phandle_with_args (dev_ofnode (dev),"atmel,nfc-sram" ,NULL ,0 ,0 , &args);if (ret) {dev_err (dev,"Missing or invalid atmel,nfc-sram property\n" );
drivers/mtd/nand/raw/atmel/pmecc.c +3 -3
@@ -833,9 +833,9 @@ atmel_pmecc_create(struct udevice *dev, pmecc->dev = dev;mutex_init (&pmecc->lock); -ofnode_read_resource (dev->node_,0 , &res); +ofnode_read_resource (dev_ofnode (dev),0 , &res); pmecc->regs.base = (void *)res.start; -ofnode_read_resource (dev->node_,1 , &res); +ofnode_read_resource (dev_ofnode (dev),1 , &res); pmecc->regs.errloc = (void *)res.start; pmecc->regs.timing =0 ;
@@ -910,7 +910,7 @@ struct atmel_pmecc *devm_atmel_pmecc_get(struct udevice *userdev)if (!userdev)return ERR_PTR (-EINVAL ); - ret =ofnode_parse_phandle_with_args (userdev->node_, + ret =ofnode_parse_phandle_with_args (dev_ofnode (userdev),"ecc-engine" ,NULL ,0 ,0 , &args);/* Probe pmecc driver */
Signature · 4 lines
2.43.0 base-commit: 62b45e82bdbf703571450e97f605893fe0d50530 branch: master
Quoted 6 lines · Andy Yan
According to commit
84a42ae36683("dm: core: Rename device node to indicate it is private")
node_should not be aaccess outside driver model.Signed-off-by Andy Yan <[email protected]>---
Applied to u-boot-at91/master, thanks !