diff options
author | Pantelis Antoniou <panto@antoniou-consulting.com> | 2014-02-26 19:28:45 +0200 |
---|---|---|
committer | Pantelis Antoniou <panto@antoniou-consulting.com> | 2014-03-24 11:32:10 +0200 |
commit | ab769f227f79bedae7840f99b6c0c4d66aafc78e (patch) | |
tree | 27d83f7ebf9da92a3ad1015cf736b7796e6ab76d /drivers/mmc/sh_mmcif.c | |
parent | 2c072c958bb544c72f0e848375803dbd6971f022 (diff) | |
download | u-boot-imx-ab769f227f79bedae7840f99b6c0c4d66aafc78e.zip u-boot-imx-ab769f227f79bedae7840f99b6c0c4d66aafc78e.tar.gz u-boot-imx-ab769f227f79bedae7840f99b6c0c4d66aafc78e.tar.bz2 |
mmc: Remove ops from struct mmc and put in mmc_ops
Remove the in-structure ops and put them in mmc_ops with
a constant pointer to it.
This makes the mmc structure smaller as well as conserving
code space (in theory).
All in-tree drivers are converted as well; this is done in a
single patch in order to not break git bisect.
Changes since V1:
Fix compilation b0rked issue on omap platforms where OMAP_GPIO was
not set.
Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Diffstat (limited to 'drivers/mmc/sh_mmcif.c')
-rw-r--r-- | drivers/mmc/sh_mmcif.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mmc/sh_mmcif.c b/drivers/mmc/sh_mmcif.c index 011d4f3..6a4860b 100644 --- a/drivers/mmc/sh_mmcif.c +++ b/drivers/mmc/sh_mmcif.c @@ -574,6 +574,12 @@ static int sh_mmcif_init(struct mmc *mmc) return 0; } +static const struct mmc_ops sh_mmcif_ops = { + .send_cmd = sh_mmcif_request, + .set_ios = sh_mmcif_set_ios, + .init = sh_mmcif_init, +}; + int mmcif_mmc_init(void) { int ret = 0; @@ -595,11 +601,7 @@ int mmcif_mmc_init(void) mmc->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT | MMC_MODE_8BIT | MMC_MODE_HC; memcpy(mmc->name, DRIVER_NAME, sizeof(DRIVER_NAME)); - mmc->send_cmd = sh_mmcif_request; - mmc->set_ios = sh_mmcif_set_ios; - mmc->init = sh_mmcif_init; - mmc->getcd = NULL; - mmc->getwp = NULL; + mmc->ops = &sh_mmcif_ops; host->regs = (struct sh_mmcif_regs *)CONFIG_SH_MMCIF_ADDR; host->clk = CONFIG_SH_MMCIF_CLK; mmc->priv = host; |