mtd: nand: sunxi: Remove an unnecessary check
authorSamuel Holland <samuel@sholland.org>
Sun, 22 Jan 2023 22:06:33 +0000 (16:06 -0600)
committerAndre Przywara <andre.przywara@arm.com>
Fri, 28 Apr 2023 00:06:57 +0000 (01:06 +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.

Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
drivers/mtd/nand/raw/sunxi_nand.c

index c378f08..0f10edf 100644 (file)
@@ -1767,16 +1767,6 @@ static int sunxi_nand_chips_init(int node, struct sunxi_nfc *nfc)
        int ret, i = 0;
 
        for (nand_node = fdt_first_subnode(blob, node); nand_node >= 0;
-            nand_node = fdt_next_subnode(blob, nand_node))
-               i++;
-
-       if (i > 8) {
-               dev_err(nfc->dev, "too many NAND chips: %d (max = 8)\n", i);
-               return -EINVAL;
-       }
-
-       i = 0;
-       for (nand_node = fdt_first_subnode(blob, node); nand_node >= 0;
             nand_node = fdt_next_subnode(blob, nand_node)) {
                ret = sunxi_nand_chip_init(nand_node, nfc, i++);
                if (ret)