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/pxa_mmc_gen.c | |
parent | 2c072c958bb544c72f0e848375803dbd6971f022 (diff) | |
download | u-boot-ab769f227f79bedae7840f99b6c0c4d66aafc78e.tar.gz |
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/pxa_mmc_gen.c')
-rw-r--r-- | drivers/mmc/pxa_mmc_gen.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mmc/pxa_mmc_gen.c b/drivers/mmc/pxa_mmc_gen.c index 29f3eaf30b..4694c8f42d 100644 --- a/drivers/mmc/pxa_mmc_gen.c +++ b/drivers/mmc/pxa_mmc_gen.c @@ -366,6 +366,12 @@ static int pxa_mmc_init(struct mmc *mmc) return 0; } +static const struct mmc_ops pxa_mmc_ops = { + .send_cmd = pxa_mmc_request, + .set_ios = pxa_mmc_set_ios, + .init = pxa_mmc_init, +}; + int pxa_mmc_register(int card_index) { struct mmc *mmc; @@ -397,10 +403,7 @@ int pxa_mmc_register(int card_index) mmc->priv = priv; sprintf(mmc->name, "PXA MMC"); - mmc->send_cmd = pxa_mmc_request; - mmc->set_ios = pxa_mmc_set_ios; - mmc->init = pxa_mmc_init; - mmc->getcd = NULL; + mmc->ops = &pxa_mmc_ops; mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34; mmc->f_max = PXAMMC_MAX_SPEED; |