summaryrefslogtreecommitdiff
path: root/include/mmc.h
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 /include/mmc.h
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 'include/mmc.h')
-rw-r--r--include/mmc.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/include/mmc.h b/include/mmc.h
index e95a237..3d53ce1 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -250,6 +250,18 @@ struct mmc_data {
uint blocksize;
};
+/* forward decl. */
+struct mmc;
+
+struct mmc_ops {
+ int (*send_cmd)(struct mmc *mmc,
+ struct mmc_cmd *cmd, struct mmc_data *data);
+ void (*set_ios)(struct mmc *mmc);
+ int (*init)(struct mmc *mmc);
+ int (*getcd)(struct mmc *mmc);
+ int (*getwp)(struct mmc *mmc);
+};
+
struct mmc {
struct list_head link;
char name[32];
@@ -283,12 +295,7 @@ struct mmc {
u64 capacity_rpmb;
u64 capacity_gp[4];
block_dev_desc_t block_dev;
- int (*send_cmd)(struct mmc *mmc,
- struct mmc_cmd *cmd, struct mmc_data *data);
- void (*set_ios)(struct mmc *mmc);
- int (*init)(struct mmc *mmc);
- int (*getcd)(struct mmc *mmc);
- int (*getwp)(struct mmc *mmc);
+ const struct mmc_ops *ops;
uint b_max;
char op_cond_pending; /* 1 if we are waiting on an op_cond command */
char init_in_progress; /* 1 if we have done mmc_start_init() */