From patchwork Fri Oct 14 07:49:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shaohui xie X-Patchwork-Id: 119736 X-Patchwork-Delegate: galak@kernel.crashing.org 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 6428AB7465 for ; Fri, 14 Oct 2011 19:59:42 +1100 (EST) Received: from DB3EHSOBE005.bigfish.com (db3ehsobe005.messaging.microsoft.com [213.199.154.143]) (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 1EF1AB6F97 for ; Fri, 14 Oct 2011 19:59:32 +1100 (EST) Received: from mail27-db3-R.bigfish.com (10.3.81.240) by DB3EHSOBE005.bigfish.com (10.3.84.25) with Microsoft SMTP Server id 14.1.225.22; Fri, 14 Oct 2011 08:59:25 +0000 Received: from mail27-db3 (localhost.localdomain [127.0.0.1]) by mail27-db3-R.bigfish.com (Postfix) with ESMTP id 682C4E303FD; Fri, 14 Oct 2011 08:59:25 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-SS: 0, Received: from mail27-db3 (localhost.localdomain [127.0.0.1]) by mail27-db3 (MessageSwitch) id 1318582732533126_11373; Fri, 14 Oct 2011 08:58:52 +0000 (UTC) Received: from DB3EHSMHS006.bigfish.com (unknown [10.3.81.253]) by mail27-db3.bigfish.com (Postfix) with ESMTP id 772ECCC0014; Fri, 14 Oct 2011 08:58:52 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS006.bigfish.com (10.3.87.106) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 14 Oct 2011 08:58:51 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.339.2; Fri, 14 Oct 2011 03:58:49 -0500 Received: from localhost.localdomain (rock.ap.freescale.net [10.193.20.106]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p9E8wkX8021449; Fri, 14 Oct 2011 03:58:47 -0500 (CDT) From: Shaohui Xie To: Subject: [PATCH] mtd: m25p80: don't probe device which has status of 'disabled' Date: Fri, 14 Oct 2011 15:49:00 +0800 Message-ID: <1318578540-12872-1-git-send-email-Shaohui.Xie@freescale.com> X-Mailer: git-send-email 1.6.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: linux-mtd@lists.infradead.org, Shaohui Xie 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 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 --- Disabled nodes should automatically not be probed. But I found this is only true for spi node, for the flash nodes which embedded in spi node, still got probed even it has a status of 'disabled'. drivers/mtd/devices/m25p80.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 4e20c4d..30d61d5 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -829,6 +830,11 @@ static int __devinit m25p_probe(struct spi_device *spi) struct mtd_partition *parts = NULL; int nr_parts = 0; +#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