mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
mmc: dw_mmc: Introduce dw_mci_alloc_host()
This helper is used for variant drivers to allocate struct dw_mci and set struct dw_mci as private data of struct mmc_host. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
3449b31eb1
commit
c72be4c306
|
|
@ -3258,6 +3258,23 @@ static void dw_mci_enable_cd(struct dw_mci *host)
|
|||
}
|
||||
}
|
||||
|
||||
struct dw_mci *dw_mci_alloc_host(struct device *dev)
|
||||
{
|
||||
struct mmc_host *mmc;
|
||||
struct dw_mci *host;
|
||||
|
||||
mmc = devm_mmc_alloc_host(dev, sizeof(struct dw_mci));
|
||||
if (!mmc)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
host = mmc_priv(mmc);
|
||||
host->mmc = mmc;
|
||||
host->dev = dev;
|
||||
|
||||
return host;
|
||||
}
|
||||
EXPORT_SYMBOL(dw_mci_alloc_host);
|
||||
|
||||
int dw_mci_probe(struct dw_mci *host)
|
||||
{
|
||||
const struct dw_mci_drv_data *drv_data = host->drv_data;
|
||||
|
|
|
|||
|
|
@ -544,6 +544,7 @@ static inline void mci_fifo_l_writeq(void __iomem *addr, u64 value)
|
|||
#define __raw_readq(__reg) (*(volatile u64 __force *)(__reg))
|
||||
#endif
|
||||
|
||||
extern struct dw_mci *dw_mci_alloc_host(struct device *device);
|
||||
extern int dw_mci_probe(struct dw_mci *host);
|
||||
extern void dw_mci_remove(struct dw_mci *host);
|
||||
#ifdef CONFIG_PM
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user