[PATCH] mtd/physmap_of: Don't add disabled flash devices

Chunhe Lan Chunhe.Lan at freescale.com
Tue Aug 16 19:25:50 EST 2011


Flash(cfi-flash, jedec-flash, and so on) nodes with the
property status="disabled" are not usable and so avoid
adding "disabled" flash devices with the system.

Signed-off-by: Chunhe Lan <Chunhe.Lan at freescale.com>
---
 drivers/mtd/maps/physmap_of.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index d251d1d..812e6dc 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -219,6 +219,9 @@ static int __devinit of_flash_probe(struct platform_device *dev)
 	struct mtd_info **mtd_list = NULL;
 	resource_size_t res_size;
 
+	if (!of_device_is_available(dp))
+		return -ENODEV;
+
 	match = of_match_device(of_flash_match, &dev->dev);
 	if (!match)
 		return -EINVAL;
-- 
1.5.6.5




More information about the Linuxppc-dev mailing list