Skip to content

Commit

Permalink
mtd: m25p80: don't probe device which has status of 'disabled'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shaohui Xie authored and Artem Bityutskiy committed Oct 16, 2011
1 parent 57468a6 commit 5f94913
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/mtd/devices/m25p80.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <linux/mtd/cfi.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/of_platform.h>

#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5f94913

Please sign in to comment.