From patchwork Tue Jul 5 15:26:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 945752 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p65FLMq9029444 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 5 Jul 2011 15:21:42 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qe7QX-0007Ir-EJ; Tue, 05 Jul 2011 15:20:41 +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 1Qe7QU-000530-2U; Tue, 05 Jul 2011 15:20:38 +0000 Received: from ch1ehsobe006.messaging.microsoft.com ([216.32.181.186] helo=CH1EHSOBE012.bigfish.com) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qe7Px-0004v8-EK for linux-arm-kernel@lists.infradead.org; Tue, 05 Jul 2011 15:20:06 +0000 Received: from mail37-ch1-R.bigfish.com (216.32.181.169) by CH1EHSOBE012.bigfish.com (10.43.70.62) with Microsoft SMTP Server id 14.1.225.22; Tue, 5 Jul 2011 15:20:00 +0000 Received: from mail37-ch1 (localhost.localdomain [127.0.0.1]) by mail37-ch1-R.bigfish.com (Postfix) with ESMTP id 6BCEB1B015A; Tue, 5 Jul 2011 15:20:00 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h61h) 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, X-FB-DOMAIN-IP-MATCH: fail Received: from mail37-ch1 (localhost.localdomain [127.0.0.1]) by mail37-ch1 (MessageSwitch) id 1309879200198546_15954; Tue, 5 Jul 2011 15:20:00 +0000 (UTC) Received: from CH1EHSMHS023.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.242]) by mail37-ch1.bigfish.com (Postfix) with ESMTP id 26DBB136804B; Tue, 5 Jul 2011 15:20:00 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS023.bigfish.com (10.43.70.23) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 5 Jul 2011 15:19:59 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.289.8; Tue, 5 Jul 2011 10:19:58 -0500 Received: from S2100-06.ap.freescale.net (S2100-06.ap.freescale.net [10.192.242.125]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p65FJoco022598; Tue, 5 Jul 2011 10:19:56 -0500 (CDT) From: Shawn Guo To: Subject: [PATCH v2 2/3] mmc: sdhci-pltfm: dt device does not pass parent to sdhci_alloc_host Date: Tue, 5 Jul 2011 23:26:07 +0800 Message-ID: <1309879568-25837-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1309879568-25837-1-git-send-email-shawn.guo@linaro.org> References: <1309879568-25837-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110705_112005_700777_8E5E96CF X-CRM114-Status: GOOD ( 16.26 ) 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: devicetree-discuss@lists.ozlabs.org, Shawn Guo , Chris Ball , linux-arm-kernel@lists.infradead.org, patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 05 Jul 2011 15:21:42 +0000 (UTC) Neither platform based nor dt based device needs to pass the parent to sdhci_alloc_host. There is no difference between platform and dt on this point. The patch makes the change to pass device itself than its parent to sdhci_alloc_host for dt case too. Otherwise the probe function of sdhci based drivers which is shared between platform and dt will fail on dt case. Signed-off-by: Shawn Guo Acked-by: Grant Likely Cc: Chris Ball --- drivers/mmc/host/sdhci-pltfm.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 71c0ce1..6414efe 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -85,6 +85,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, { struct sdhci_host *host; struct sdhci_pltfm_host *pltfm_host; + struct device_node *np = pdev->dev.of_node; struct resource *iomem; int ret; @@ -98,7 +99,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, dev_err(&pdev->dev, "Invalid iomem size!\n"); /* Some PCI-based MFD need the parent here */ - if (pdev->dev.parent != &platform_bus) + if (pdev->dev.parent != &platform_bus && !np) host = sdhci_alloc_host(pdev->dev.parent, sizeof(*pltfm_host)); else host = sdhci_alloc_host(&pdev->dev, sizeof(*pltfm_host));