Re: [patch 1/3] sdhci-pltfm: add call back alloc_host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 26, 2010 at 10:55 PM, zhangfei gao <zhangfei.gao@xxxxxxxxx> wrote:
> From 7a870a620fa868ed4ce0cffcbd6b0683a00ae2e5 Mon Sep 17 00:00:00 2001
> From: Zhangfei Gao <zhangfei.gao@xxxxxxxxxxx>
> 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 <zhangfei.gao@xxxxxxxxxxx>
> ---
>  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
>

Any feed back, much thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux