Patchwork [5/5] mtd: nand-gpio: Do not override GPIOs if driver uses platform_data but OF is enabled in kernel config

login
register
mail settings
Submitter Alexander Shiyan
Date April 13, 2013, 7:06 a.m.
Message ID <1365836798-29035-5-git-send-email-shc_work@mail.ru>
Download mbox | patch
Permalink /patch/236301/
State Accepted
Commit ee4f36663b2a3626a9dadb2679a0ddcff1371891
Headers show

Comments

Alexander Shiyan - April 13, 2013, 7:06 a.m.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/mtd/nand/gpio.c | 3 +++
 1 file changed, 3 insertions(+)

Patch

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;