From patchwork Tue Aug 16 09:25:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunhe Lan X-Patchwork-Id: 110162 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DBD5DB6F94 for ; Tue, 16 Aug 2011 19:23:43 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QtFrw-0004UG-BA; Tue, 16 Aug 2011 09:23:32 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QtFrv-00011W-Qp; Tue, 16 Aug 2011 09:23:31 +0000 Received: from ch1ehsobe006.messaging.microsoft.com ([216.32.181.186] helo=ch1outboundpool.messaging.microsoft.com) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QtFrt-00011E-72 for linux-mtd@lists.infradead.org; Tue, 16 Aug 2011 09:23:29 +0000 Received: from mail31-ch1-R.bigfish.com (216.32.181.168) by CH1EHSOBE010.bigfish.com (10.43.70.60) with Microsoft SMTP Server id 14.1.225.22; Tue, 16 Aug 2011 09:23:25 +0000 Received: from mail31-ch1 (localhost.localdomain [127.0.0.1]) by mail31-ch1-R.bigfish.com (Postfix) with ESMTP id 77D0E132019B; Tue, 16 Aug 2011 09:23:25 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h64h) X-Spam-TCS-SCL: 3:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail31-ch1 (localhost.localdomain [127.0.0.1]) by mail31-ch1 (MessageSwitch) id 1313486605408146_22299; Tue, 16 Aug 2011 09:23:25 +0000 (UTC) Received: from CH1EHSMHS024.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.242]) by mail31-ch1.bigfish.com (Postfix) with ESMTP id 5EA01158804D; Tue, 16 Aug 2011 09:23:25 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS024.bigfish.com (10.43.70.24) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 16 Aug 2011 09:23:25 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.323.2; Tue, 16 Aug 2011 04:23:24 -0500 Received: from localhost.localdomain ([10.193.20.71]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p7G9NKTx003816; Tue, 16 Aug 2011 04:23:21 -0500 (CDT) From: Chunhe Lan To: Subject: [PATCH] mtd/physmap_of: Don't add disabled flash devices Date: Tue, 16 Aug 2011 17:25:50 +0800 Message-ID: <1313486750-15211-1-git-send-email-Chunhe.Lan@freescale.com> X-Mailer: git-send-email 1.5.6.5 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110816_052329_331961_206A65D5 X-CRM114-Status: GOOD ( 12.95 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.32.181.186 listed in list.dnswl.org] Cc: kumar.gala@freescale.com, linuxppc-dev@ozlabs.org, scottwood@freescale.com, akpm@linux-foundation.org, dwmw2@infradead.org, Chunhe Lan X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 --- 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;