[PATCH 3/6] mtd: nand: sunxi: Remove an unnecessary check

Michael Nazzareno Trimarchi michael at amarulasolutions.com
Sun Jul 17 16:01:41 CEST 2022


Hi

On Thu, Jul 14, 2022 at 5:15 AM Samuel Holland <samuel at sholland.org> wrote:
>
> 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 at sholland.org>
> ---
>
>  drivers/mtd/nand/raw/sunxi_nand.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c
> index c378f08f6805..0f10edfdb208 100644
> --- a/drivers/mtd/nand/raw/sunxi_nand.c
> +++ b/drivers/mtd/nand/raw/sunxi_nand.c
> @@ -1766,16 +1766,6 @@ static int sunxi_nand_chips_init(int node, struct sunxi_nfc *nfc)
>         int nand_node;
>         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++);
> --
> 2.35.1
>

Reviewed-by: Michael Trimarchi <michael at amarulasolutions.com>


--
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael at amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info at amarulasolutions.com
www.amarulasolutions.com


More information about the U-Boot mailing list