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

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Aug 5 16:59:02 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=ee4f36663b2a3626a9dadb2679a0ddcff1371891
Commit:     ee4f36663b2a3626a9dadb2679a0ddcff1371891
Parent:     c85d32d56859bb01f775e12771150dc47a7b03ba
Author:     Alexander Shiyan <shc_work at mail.ru>
AuthorDate: Mon May 6 17:53:50 2013 +0400
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Aug 5 20:45:16 2013 +0100

    mtd: nand-gpio: Do not override GPIOs if driver uses platform_data but OF is enabled in kernel config
    
    Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 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;



More information about the linux-mtd-cvs mailing list