From patchwork Wed Jul 6 16:47:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2490 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7FACF2413B for ; Wed, 6 Jul 2011 16:41:41 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 500DAA18ACE for ; Wed, 6 Jul 2011 16:41:41 +0000 (UTC) Received: by qyk30 with SMTP id 30so81836qyk.11 for ; Wed, 06 Jul 2011 09:41:40 -0700 (PDT) Received: by 10.229.54.12 with SMTP id o12mr3019332qcg.80.1309970500798; Wed, 06 Jul 2011 09:41:40 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.48.135 with SMTP id r7cs84178qcf; Wed, 6 Jul 2011 09:41:40 -0700 (PDT) Received: by 10.227.166.9 with SMTP id k9mr4108563wby.57.1309970499868; Wed, 06 Jul 2011 09:41:39 -0700 (PDT) Received: from DB3EHSOBE002.bigfish.com (db3ehsobe002.messaging.microsoft.com [213.199.154.140]) by mx.google.com with ESMTPS id en14si16965508wbb.4.2011.07.06.09.41.39 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Jul 2011 09:41:39 -0700 (PDT) Received-SPF: neutral (google.com: 213.199.154.140 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=213.199.154.140; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.140 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: from mail110-db3-R.bigfish.com (10.3.81.250) by DB3EHSOBE002.bigfish.com (10.3.84.22) with Microsoft SMTP Server id 14.1.225.22; Wed, 6 Jul 2011 16:41:39 +0000 Received: from mail110-db3 (localhost.localdomain [127.0.0.1]) by mail110-db3-R.bigfish.com (Postfix) with ESMTP id DFDE81AB8287; Wed, 6 Jul 2011 16:41:38 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h) 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-DOMAIN-IP-MATCH: fail Received: from mail110-db3 (localhost.localdomain [127.0.0.1]) by mail110-db3 (MessageSwitch) id 1309970498761036_5371; Wed, 6 Jul 2011 16:41:38 +0000 (UTC) Received: from DB3EHSMHS008.bigfish.com (unknown [10.3.81.245]) by mail110-db3.bigfish.com (Postfix) with ESMTP id B149F12804B; Wed, 6 Jul 2011 16:41:38 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS008.bigfish.com (10.3.87.108) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 6 Jul 2011 16:41:34 +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.289.8; Wed, 6 Jul 2011 11:41:32 -0500 Received: from S2100-06.ap.freescale.net (S2100-06.ap.freescale.net [10.192.242.125]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p66GfLGw027675; Wed, 6 Jul 2011 11:41:30 -0500 (CDT) From: Shawn Guo To: CC: , , , Shawn Guo , Chris Ball Subject: [PATCH v3 3/4] mmc: sdhci-pltfm: dt device does not pass parent to sdhci_alloc_host Date: Thu, 7 Jul 2011 00:47:49 +0800 Message-ID: <1309970870-13336-4-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1309970870-13336-1-git-send-email-shawn.guo@linaro.org> References: <1309970870-13336-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com 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));