Merge tag 'u-boot-at91-fixes-2023.10-b' of https://source.denx.de/u-boot/custodians...
authorTom Rini <trini@konsulko.com>
Fri, 29 Sep 2023 14:40:34 +0000 (10:40 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 29 Sep 2023 14:40:34 +0000 (10:40 -0400)
Second set of u-boot-atmel fixes for the 2023.10 cycle:

Two small fixes , one for an array not initialized and the second one
fixes an error case when a DT property is missing for the atmel NAND
driver.

drivers/clk/at91/sam9x60.c
drivers/clk/at91/sama7g5.c
drivers/mtd/nand/raw/atmel/nand-controller.c

index e2f7244..d858c86 100644 (file)
@@ -429,8 +429,8 @@ static int sam9x60_clk_probe(struct udevice *dev)
        if (!base)
                return -EINVAL;
 
-       memset(muxallocs,    0, ARRAY_SIZE(muxallocs));
-       memset(clkmuxallocs, 0, ARRAY_SIZE(clkmuxallocs));
+       memset(muxallocs,    0, sizeof(muxallocs));
+       memset(clkmuxallocs, 0, sizeof(clkmuxallocs));
 
        ret = clk_get_by_index(dev, 0, &clk);
        if (ret)
index 3abd220..3e62fb1 100644 (file)
@@ -1115,8 +1115,8 @@ static int sama7g5_clk_probe(struct udevice *dev)
        if (IS_ERR(base))
                return PTR_ERR(base);
 
-       memset(muxallocs,    0, ARRAY_SIZE(muxallocs));
-       memset(clkmuxallocs, 0, ARRAY_SIZE(clkmuxallocs));
+       memset(muxallocs,    0, sizeof(muxallocs));
+       memset(clkmuxallocs, 0, sizeof(clkmuxallocs));
 
        ret = clk_get_by_index(dev, 0, &clk);
        if (ret)
index 9873d11..950e626 100644 (file)
@@ -1601,10 +1601,13 @@ static struct atmel_nand *atmel_nand_create(struct atmel_nand_controller *nc,
                        nand->cs[i].rb.type = ATMEL_NAND_NATIVE_RB;
                        nand->cs[i].rb.id = val;
                } else {
-                       gpio_request_by_name_nodev(np, "rb-gpios", 0,
-                                                  &nand->cs[i].rb.gpio,
-                                                  GPIOD_IS_IN);
-                       nand->cs[i].rb.type = ATMEL_NAND_GPIO_RB;
+                       ret = gpio_request_by_name_nodev(np, "rb-gpios", 0,
+                                                        &nand->cs[i].rb.gpio,
+                                                        GPIOD_IS_IN);
+                       if (ret && ret != -ENOENT)
+                               dev_err(nc->dev, "Failed to get R/B gpio (err = %d)\n", ret);
+                       if (!ret)
+                               nand->cs[i].rb.type = ATMEL_NAND_GPIO_RB;
                }
 
                gpio_request_by_name_nodev(np, "cs-gpios", 0,