From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from am1ehsobe001.messaging.microsoft.com ([213.199.154.204] helo=AM1EHSOBE001.bigfish.com) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QvRIW-0002ET-0l for linux-mtd@lists.infradead.org; Mon, 22 Aug 2011 10:00:00 +0000 Content-Type: text/plain; charset="utf-8"; format=flowed; delsp=yes To: Scott Wood , Chunhe Lan Subject: Re: [PATCH] mtd/physmap_of: Don't add disabled flash devices References: <1313486750-15211-1-git-send-email-Chunhe.Lan@freescale.com> <4E4AE4D8.1080903@freescale.com> Date: Mon, 22 Aug 2011 18:02:47 +0800 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Lan Chunhe Message-ID: In-Reply-To: <4E4AE4D8.1080903@freescale.com> Cc: dwmw2@infradead.org, kumar.gala@freescale.com, linux-mtd@lists.infradead.org, akpm@linux-foundation.org, linuxppc-dev@ozlabs.org List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 17 Aug 2011 05:44:56 +0800, Scott Wood wrote: > On 08/16/2011 04:25 AM, Chunhe Lan wrote: >> 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; > > Are you actually seeing unavailable devices get probed? I thought the > upper layers were supposed to prevent that. You are right. The upper layers have prevented unavailable devices. So, this patch is no need. Thanks. -Jack Lan > -Scott