From ab769f227f79bedae7840f99b6c0c4d66aafc78e Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 26 Feb 2014 19:28:45 +0200 Subject: 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 --- include/mmc.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'include/mmc.h') diff --git a/include/mmc.h b/include/mmc.h index e95a2376d2..3d53ce113c 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() */ -- cgit v1.2.3