From patchwork Tue Sep 28 12:36:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 214802 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8SCbICM002468 for ; Tue, 28 Sep 2010 12:37:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753489Ab0I1MhS (ORCPT ); Tue, 28 Sep 2010 08:37:18 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:54513 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753800Ab0I1MhP (ORCPT ); Tue, 28 Sep 2010 08:37:15 -0400 Received: from katana.hi.pengutronix.de ([2001:6f8:1178:2:221:70ff:fe71:1890] helo=pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.71) (envelope-from ) id 1P0ZQo-0003HU-M2; Tue, 28 Sep 2010 14:37:14 +0200 From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: Anton Vorontsov , zhangfei gao , Zhu Richard-R65037 , Philip Rakity , Wolfram Sang Subject: [PATCH 4/6] mmc: sdhci_pltfm: pass platform_data on custom init-call Date: Tue, 28 Sep 2010 14:36:44 +0200 Message-Id: <1285677406-3359-5-git-send-email-w.sang@pengutronix.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1285677406-3359-1-git-send-email-w.sang@pengutronix.de> References: <1285677406-3359-1-git-send-email-w.sang@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:221:70ff:fe71:1890 X-SA-Exim-Mail-From: w.sang@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mmc@vger.kernel.org Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 28 Sep 2010 12:37:22 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index ff0271c..4076222 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -52,15 +52,20 @@ static struct sdhci_ops sdhci_pltfm_ops = { static int __devinit sdhci_pltfm_probe(struct platform_device *pdev) { - struct sdhci_pltfm_data *pdata = pdev->dev.platform_data; const struct platform_device_id *platid = platform_get_device_id(pdev); + struct sdhci_pltfm_data *pdata; + void *priv_pdata = NULL; struct sdhci_host *host; struct sdhci_pltfm_host *pltfm_host; struct resource *iomem; int ret; - if (!pdata && platid && platid->driver_data) + if (platid && platid->driver_data) { pdata = (void *)platid->driver_data; + priv_pdata = pdev->dev.platform_data; + } else { + pdata = pdev->dev.platform_data; + } iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!iomem) { @@ -108,7 +113,7 @@ static int __devinit sdhci_pltfm_probe(struct platform_device *pdev) } if (pdata && pdata->init) { - ret = pdata->init(host); + ret = pdata->init(host, pdata, priv_pdata); if (ret) goto err_plat_init; } diff --git a/include/linux/mmc/sdhci-pltfm.h b/include/linux/mmc/sdhci-pltfm.h index 0239bd7..cafb96b 100644 --- a/include/linux/mmc/sdhci-pltfm.h +++ b/include/linux/mmc/sdhci-pltfm.h @@ -28,7 +28,8 @@ struct sdhci_host; struct sdhci_pltfm_data { struct sdhci_ops *ops; unsigned int quirks; - int (*init)(struct sdhci_host *host); + int (*init)(struct sdhci_host *host, struct sdhci_pltfm_data *pdata, + void *priv_pdata); void (*exit)(struct sdhci_host *host); };