Received: from smtp27.mail.ru ([94.100.176.180]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1USs3M-0003oX-GJ for linux-mtd@lists.infradead.org; Thu, 18 Apr 2013 16:51:22 +0000 From: Alexander Shiyan To: linux-mtd@lists.infradead.org Subject: [PATCH RESEND 5/5] mtd: nand-gpio: Do not override GPIOs if driver uses platform_data but OF is enabled in kernel config Date: Thu, 18 Apr 2013 20:50:46 +0400 Message-Id: <1366303846-20384-6-git-send-email-shc_work@mail.ru> In-Reply-To: <1366303846-20384-1-git-send-email-shc_work@mail.ru> References: <1366303846-20384-1-git-send-email-shc_work@mail.ru> Cc: Artem Bityutskiy , Brian Norris , David Woodhouse , Alexander Shiyan List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Signed-off-by: Alexander Shiyan --- 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