Commit 5f949137 authored by Shaohui Xie's avatar Shaohui Xie Committed by Artem Bityutskiy

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: default avatarShaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent 57468a64
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/mtd/cfi.h> #include <linux/mtd/cfi.h>
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/of_platform.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/flash.h> #include <linux/spi/flash.h>
...@@ -823,6 +824,11 @@ static int __devinit m25p_probe(struct spi_device *spi) ...@@ -823,6 +824,11 @@ static int __devinit m25p_probe(struct spi_device *spi)
unsigned i; unsigned i;
struct mtd_part_parser_data ppdata; 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 /* Platform data helps sort out which chip type we have, as
* well as how this board partitions it. If we don't have * 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 * a chip ID, try the JEDEC id commands; they'll work for most
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment