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/davinci_mmc.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/davinci_mmc.c')
-rw-r--r-- | drivers/mmc/davinci_mmc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/mmc/davinci_mmc.c b/drivers/mmc/davinci_mmc.c index b380961..29ca4a6 100644 --- a/drivers/mmc/davinci_mmc.c +++ b/drivers/mmc/davinci_mmc.c @@ -363,6 +363,12 @@ static void dmmc_set_ios(struct mmc *mmc) dmmc_set_clock(mmc, mmc->clock); } +static const struct mmc_ops dmmc_ops = { + .send_cmd = dmmc_send_cmd, + .set_ios = dmmc_set_ios, + .init = dmmc_init, +}; + /* Called from board_mmc_init during startup. Can be called multiple times * depending on the number of slots available on board and controller */ @@ -375,12 +381,7 @@ int davinci_mmc_init(bd_t *bis, struct davinci_mmc *host) sprintf(mmc->name, "davinci"); mmc->priv = host; - mmc->send_cmd = dmmc_send_cmd; - mmc->set_ios = dmmc_set_ios; - mmc->init = dmmc_init; - mmc->getcd = NULL; - mmc->getwp = NULL; - + mmc->ops = &dmmc_ops; mmc->f_min = 200000; mmc->f_max = 25000000; mmc->voltages = host->voltages; |