From f324dab088c7ecb224a4c957a1ce93a306f9a567 Mon Sep 17 00:00:00 2001 From: Shaohui Xie Date: Fri, 14 Oct 2011 15:49:00 +0800 Subject: [PATCH] --- yaml --- r: 274966 b: refs/heads/master c: 5f949137952020214cd167093dd7be448f21c079 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/mtd/devices/m25p80.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 1f725823e30e..4133ba4feb40 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 57468a646e513bd88aeaa322eee2a8a960df91fc +refs/heads/master: 5f949137952020214cd167093dd7be448f21c079 diff --git a/trunk/drivers/mtd/devices/m25p80.c b/trunk/drivers/mtd/devices/m25p80.c index 02aecacd1994..884904d3f9d2 100644 --- a/trunk/drivers/mtd/devices/m25p80.c +++ b/trunk/drivers/mtd/devices/m25p80.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -823,6 +824,11 @@ static int __devinit m25p_probe(struct spi_device *spi) unsigned i; struct mtd_part_parser_data ppdata; +#ifdef CONFIG_MTD_OF_PARTS + if (!of_device_is_available(spi->dev.of_node)) + return -ENODEV; +#endif + /* Platform data helps sort out which chip type we have, as * well as how this board partitions it. If we don't have * a chip ID, try the JEDEC id commands; they'll work for most