OSDN Git Service

mtd: rawnand: sunxi: Remove an unnecessary check
authorSamuel Holland <samuel@sholland.org>
Thu, 29 Dec 2022 18:15:22 +0000 (12:15 -0600)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 2 Jan 2023 11:14:21 +0000 (12:14 +0100)
Each chip is required to have a unique CS number ("reg" property) in the
range 0-7, so there is no need to separately count the number of chips.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20221229181526.53766-4-samuel@sholland.org
drivers/mtd/nand/raw/sunxi_nand.c

index 8b221f9..1bddeb1 100644 (file)
@@ -2060,14 +2060,8 @@ static int sunxi_nand_chips_init(struct device *dev, struct sunxi_nfc *nfc)
 {
        struct device_node *np = dev->of_node;
        struct device_node *nand_np;
-       int nchips = of_get_child_count(np);
        int ret;
 
-       if (nchips > 8) {
-               dev_err(dev, "too many NAND chips: %d (max = 8)\n", nchips);
-               return -EINVAL;
-       }
-
        for_each_child_of_node(np, nand_np) {
                ret = sunxi_nand_chip_init(dev, nfc, nand_np);
                if (ret) {