summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/mxsmmc.c
diff options
context:
space:
mode:
authorPantelis Antoniou <panto@antoniou-consulting.com>2014-02-26 19:28:45 +0200
committerPantelis Antoniou <panto@antoniou-consulting.com>2014-03-24 11:32:10 +0200
commitab769f227f79bedae7840f99b6c0c4d66aafc78e (patch)
tree27d83f7ebf9da92a3ad1015cf736b7796e6ab76d /drivers/mmc/mxsmmc.c
parent2c072c958bb544c72f0e848375803dbd6971f022 (diff)
downloadtalos-obmc-uboot-ab769f227f79bedae7840f99b6c0c4d66aafc78e.tar.gz
talos-obmc-uboot-ab769f227f79bedae7840f99b6c0c4d66aafc78e.zip
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/mxsmmc.c')
-rw-r--r--drivers/mmc/mxsmmc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
index 245f9d0c67..97c9ee8fb6 100644
--- a/drivers/mmc/mxsmmc.c
+++ b/drivers/mmc/mxsmmc.c
@@ -363,6 +363,12 @@ static int mxsmmc_init(struct mmc *mmc)
return 0;
}
+static const struct mmc_ops mxsmmc_ops = {
+ .send_cmd = mxsmmc_send_cmd,
+ .set_ios = mxsmmc_set_ios,
+ .init = mxsmmc_init,
+};
+
int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int), int (*cd)(int))
{
struct mmc *mmc = NULL;
@@ -400,11 +406,7 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int), int (*cd)(int))
priv->regs = mxs_ssp_regs_by_bus(id);
sprintf(mmc->name, "MXS MMC");
- mmc->send_cmd = mxsmmc_send_cmd;
- mmc->set_ios = mxsmmc_set_ios;
- mmc->init = mxsmmc_init;
- mmc->getcd = NULL;
- mmc->getwp = NULL;
+ mmc->ops = &mxsmmc_ops;
mmc->priv = priv;
mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
OpenPOWER on IntegriCloud