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: 110163 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 9F833B71F1 for ; Tue, 16 Aug 2011 19:23:45 +1000 (EST) Received: by ozlabs.org (Postfix) id DDA8AB6F7E; Tue, 16 Aug 2011 19:23:34 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe004.messaging.microsoft.com [216.32.181.184]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "Microsoft Secure Server Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 26A37B6F7B for ; Tue, 16 Aug 2011 19:23:32 +1000 (EST) 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 Cc: kumar.gala@freescale.com, linuxppc-dev@ozlabs.org, scottwood@freescale.com, akpm@linux-foundation.org, dwmw2@infradead.org, Chunhe Lan X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.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;