From patchwork Sun Jul 3 08:30:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2429 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 E1F542412F for ; Sun, 3 Jul 2011 08:20:30 +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 B2DA8A18064 for ; Sun, 3 Jul 2011 08:20:30 +0000 (UTC) Received: by mail-qy0-f180.google.com with SMTP id 30so3026303qyk.11 for ; Sun, 03 Jul 2011 01:20:30 -0700 (PDT) Received: by 10.229.54.12 with SMTP id o12mr199471qcg.80.1309681230466; Sun, 03 Jul 2011 01:20:30 -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 r7cs4268qcf; Sun, 3 Jul 2011 01:20:30 -0700 (PDT) Received: by 10.42.173.131 with SMTP id r3mr5811265icz.441.1309681229936; Sun, 03 Jul 2011 01:20:29 -0700 (PDT) Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.214.178]) by mx.google.com with ESMTPS id c3si15248089ict.153.2011.07.03.01.20.29 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jul 2011 01:20:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.214.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by mail-iw0-f178.google.com with SMTP id 10so4619554iwc.37 for ; Sun, 03 Jul 2011 01:20:29 -0700 (PDT) Received: by 10.42.21.204 with SMTP id l12mr5216117icb.341.1309681229625; Sun, 03 Jul 2011 01:20:29 -0700 (PDT) Received: from localhost.localdomain ([114.218.201.201]) by mx.google.com with ESMTPS id y1sm5180838ica.16.2011.07.03.01.20.22 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jul 2011 01:20:29 -0700 (PDT) From: Shawn Guo To: linux-mmc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, patches@linaro.org, Shawn Guo , Chris Ball , Grant Likely Subject: [PATCH 2/3] mmc: sdhci-pltfm: dt device does not pass parent to sdhci_alloc_host Date: Sun, 3 Jul 2011 16:30:50 +0800 Message-Id: <1309681851-23052-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1309681851-23052-1-git-send-email-shawn.guo@linaro.org> References: <1309681851-23052-1-git-send-email-shawn.guo@linaro.org> 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 Cc: Chris Ball Cc: Grant Likely Acked-by: Grant Likely --- 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));