On Tue, Sep 28, 2010 at 10:08:27AM -0400, zhangfei gao wrote: > 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. I had this in mind when creating the patch which added the host-structure. But I came to the same conclusion as Anton that it seems overengineered at this point. How much private data would you need? Regards, Wolfram -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Attachment:
signature.asc
Description: Digital signature