[U-Boot] [RFC] mmc: Remove ops from struct mmc and put in mmc_ops

Tom Rini trini at ti.com
Thu Feb 27 14:46:36 CET 2014


On Wed, Feb 26, 2014 at 07:52:24PM +0200, Pantelis Antoniou wrote:

> 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.
> 
> Signed-off-by: Pantelis Antoniou <panto at antoniou-consulting.com>
[snip]
> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
> index d3a8b53..4b27097 100644
> --- a/drivers/mmc/omap_hsmmc.c
> +++ b/drivers/mmc/omap_hsmmc.c
> @@ -70,25 +70,12 @@ static int omap_mmc_setup_gpio_in(int gpio, const char *label)
>  	return gpio;
>  }
>  
> -static int omap_mmc_getcd(struct mmc *mmc)
> -{
> -	int cd_gpio = ((struct omap_hsmmc_data *)mmc->priv)->cd_gpio;
> -	return gpio_get_value(cd_gpio);
> -}
> -
> -static int omap_mmc_getwp(struct mmc *mmc)
> -{
> -	int wp_gpio = ((struct omap_hsmmc_data *)mmc->priv)->wp_gpio;
> -	return gpio_get_value(wp_gpio);
> -}
>  #else
>  static inline int omap_mmc_setup_gpio_in(int gpio, const char *label)
>  {
>  	return -1;
>  }
>  
> -#define omap_mmc_getcd NULL
> -#define omap_mmc_getwp NULL
>  #endif

Note that we're not just testing for SPL in the above we're also testing
for OMAP_GPIO being set.  So this breaks am3517_evm tseries_spi mcx
am3517_crane omap3_evm_quick_mmc omap3_evm omap3_zoom1 omap3_sdp3430 and
tseries_mmc.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140227/8ab223a3/attachment.pgp>


More information about the U-Boot mailing list