aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorShaohui Xie <Shaohui.Xie@freescale.com>2011-10-14 03:49:00 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-10-16 07:51:04 -0400
commit5f949137952020214cd167093dd7be448f21c079 (patch)
tree930e0c6799626204ade4522a5aa22ba24b2f3e5e /drivers/mtd/devices
parent57468a646e513bd88aeaa322eee2a8a960df91fc (diff)
mtd: m25p80: don't probe device which has status of 'disabled'
On some platforms such as P3060QDS, has multiple spi flashes, but they are not available at same time, so if their status is 'disabled', which is set by u-boot, will not be probed. Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/m25p80.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 02aecacd1994..884904d3f9d2 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -30,6 +30,7 @@
30#include <linux/mtd/cfi.h> 30#include <linux/mtd/cfi.h>
31#include <linux/mtd/mtd.h> 31#include <linux/mtd/mtd.h>
32#include <linux/mtd/partitions.h> 32#include <linux/mtd/partitions.h>
33#include <linux/of_platform.h>
33 34
34#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
35#include <linux/spi/flash.h> 36#include <linux/spi/flash.h>
@@ -823,6 +824,11 @@ static int __devinit m25p_probe(struct spi_device *spi)
823 unsigned i; 824 unsigned i;
824 struct mtd_part_parser_data ppdata; 825 struct mtd_part_parser_data ppdata;
825 826
827#ifdef CONFIG_MTD_OF_PARTS
828 if (!of_device_is_available(spi->dev.of_node))
829 return -ENODEV;
830#endif
831
826 /* Platform data helps sort out which chip type we have, as 832 /* Platform data helps sort out which chip type we have, as
827 * well as how this board partitions it. If we don't have 833 * well as how this board partitions it. If we don't have
828 * a chip ID, try the JEDEC id commands; they'll work for most 834 * a chip ID, try the JEDEC id commands; they'll work for most