[PATCH v2 3/7] mtd: nand-gpio: Do not override GPIOs if driver uses platform_data but OF is enabled in kernel config
Alexander Shiyan
shc_work at mail.ru
Fri Apr 26 14:57:24 EDT 2013
Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
---
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 8f102d1..0d26f8b 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;
--
1.8.1.5
More information about the linux-mtd
mailing list