summaryrefslogtreecommitdiff
path: root/drivers/mmc/mmc_spi.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/mmc_spi.c
parent2c072c958bb544c72f0e848375803dbd6971f022 (diff)
downloadu-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/mmc_spi.c')
-rw-r--r--drivers/mmc/mmc_spi.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
index fe6a5a1..0a0f894 100644
--- a/drivers/mmc/mmc_spi.c
+++ b/drivers/mmc/mmc_spi.c
@@ -255,6 +255,12 @@ static int mmc_spi_init_p(struct mmc *mmc)
return 0;
}
+static const struct mmc_ops mmc_spi_ops = {
+ .send_cmd = mmc_spi_request,
+ .set_ios = mmc_spi_set_ios,
+ .init = mmc_spi_init_p,
+};
+
struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode)
{
struct mmc *mmc;
@@ -269,11 +275,7 @@ struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode)
return NULL;
}
sprintf(mmc->name, "MMC_SPI");
- mmc->send_cmd = mmc_spi_request;
- mmc->set_ios = mmc_spi_set_ios;
- mmc->init = mmc_spi_init_p;
- mmc->getcd = NULL;
- mmc->getwp = NULL;
+ mmc->ops = &mmc_spi_ops;
mmc->host_caps = MMC_MODE_SPI;
mmc->voltages = MMC_SPI_VOLTAGE;