[PATCH 5/5] 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
Sat Apr 13 03:06:38 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 16b8eeb..ea8adb5 100644
--- a/drivers/mtd/nand/gpio.c
+++ b/drivers/mtd/nand/gpio.c
@@ -105,6 +105,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