From ee4f36663b2a3626a9dadb2679a0ddcff1371891 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Mon, 6 May 2013 17:53:50 +0400 Subject: [PATCH] mtd: nand-gpio: Do not override GPIOs if driver uses platform_data but OF is enabled in kernel config Signed-off-by: Alexander Shiyan Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- drivers/mtd/nand/gpio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c index 8f102d162126..0d26f8b7d9d0 100644 --- a/drivers/mtd/nand/gpio.c +++ b/drivers/mtd/nand/gpio.c @@ -151,6 +151,9 @@ static int gpio_nand_get_config_of(const struct device *dev, { u32 val; + if (!dev->of_node) + return -ENODEV; + if (!of_property_read_u32(dev->of_node, "bank-width", &val)) { if (val == 2) { plat->options |= NAND_BUSWIDTH_16; -- 2.20.1