]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mtd: nand: raw: atmel: Access device ofnode through functions
authorAndy Yan <andyshrk@163.com>
Fri, 30 Jan 2026 02:17:37 +0000 (10:17 +0800)
committerEugen Hristev <eugen.hristev@linaro.org>
Wed, 4 Feb 2026 12:13:02 +0000 (14:13 +0200)
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 <andyshrk@163.com>
drivers/mtd/nand/raw/atmel/nand-controller.c
drivers/mtd/nand/raw/atmel/pmecc.c

index c90a4eab8df073c7ebfabc419ceaa386bc76399e..d6e940d4a90ce7b3f4999d0830e45fc392818f40 100644 (file)
@@ -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 *nc
        int 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 *nc
        if (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 *nc
                return 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");
index 1acaa5d0e0783f11be8236ad12b42540ca530a5b..e25d782aa30aa6dff7e29447b184b879d9586e99 100644 (file)
@@ -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 data setup time */
@@ -913,7 +913,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 */