From patchwork Mon Sep 27 02:55:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 210652 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 o8R2tlnU032415 for ; Mon, 27 Sep 2010 02:55:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932420Ab0I0Czr (ORCPT ); Sun, 26 Sep 2010 22:55:47 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:61216 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932305Ab0I0Czq (ORCPT ); Sun, 26 Sep 2010 22:55:46 -0400 Received: by iwn5 with SMTP id 5so4370335iwn.19 for ; Sun, 26 Sep 2010 19:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:cc:content-type; bh=bLEKFTRYE+/wBSR4mA/uPq08UkQEANTg94Ts8O1q/0E=; b=Iuj7g9neiHaf7hqvofVcPXFdaQXz+Imdb1PTRl3W2PZ6rXJyK5sV+Mg20CyuS40QeM vRN2Ygmk+9/RLeJ2ksBj6NT9KYpzuujWzWZNqYfiCvo+XiG9tYtNmKRGBdSJ+OOyXpGT hHA12tIFD8zdHgxtlQ6pcUBFaDDauoqmCQK58= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=LGhSUb8bAJYu77+50J7cmbaC8iggfRHPhpHsXkmX7N+VzeP8mpCwNk7UC6R9cYVoDO yfDhFOAOVthZPCYlCFSVmTyzNQmSw5QWUoZ/eg2/9MwJWPlP840Cf94kb6OKS82QuAg7 8drcIfYMAw/xEczmyoEC3bivAf/s+OnsI7U9o= MIME-Version: 1.0 Received: by 10.231.182.201 with SMTP id cd9mr8505041ibb.21.1285556146038; Sun, 26 Sep 2010 19:55:46 -0700 (PDT) Received: by 10.231.206.203 with HTTP; Sun, 26 Sep 2010 19:55:46 -0700 (PDT) Date: Sun, 26 Sep 2010 22:55:46 -0400 Message-ID: Subject: [patch 1/3] sdhci-pltfm: add call back alloc_host From: zhangfei gao To: linux-mmc@vger.kernel.org Cc: Chris Ball , Wolfram Sang , eric.y.miao@gmail.com, Haojian Zhuang 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]); Mon, 27 Sep 2010 02:55:49 +0000 (UTC) From 7a870a620fa868ed4ce0cffcbd6b0683a00ae2e5 Mon Sep 17 00:00:00 2001 From: Zhangfei Gao Date: Mon, 27 Sep 2010 10:30:01 -0400 Subject: [PATCH 1/3] sdhci-pltfm: add call back alloc_host alloc_host could alloc specific structure of device to meet different requirement Signed-off-by: Zhangfei Gao --- drivers/mmc/host/sdhci-pltfm.c | 4 ++-- include/linux/sdhci-pltfm.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 9669f21..82d3d05 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -76,8 +76,8 @@ static int __devinit sdhci_pltfm_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Invalid iomem size. You may " "experience problems.\n"); - if (pdev->dev.parent) - host = sdhci_alloc_host(pdev->dev.parent, 0); + if (pdata && pdata->alloc_host) + host = pdata->alloc_host(&pdev->dev); else host = sdhci_alloc_host(&pdev->dev, 0); diff --git a/include/linux/sdhci-pltfm.h b/include/linux/sdhci-pltfm.h index e14fce3..80c415e 100644 --- a/include/linux/sdhci-pltfm.h +++ b/include/linux/sdhci-pltfm.h @@ -30,6 +30,7 @@ struct sdhci_pltfm_data { unsigned int quirks; int (*init)(struct sdhci_host *host, struct sdhci_pltfm_data *pdata, void* priv_pdata); void (*exit)(struct sdhci_host *host); + struct sdhci_host *(*alloc_host)(struct device *dev); }; #endif /* _SDHCI_PLTFM_H */ -- 1.7.0.4