mirror of
https://xff.cz/git/u-boot/
synced 2025-09-25 04:21:18 +02:00
mmc: omap_hsmmc: do not embed struct mmc in struct omap_hsmmc_plat
The area for struct mmc can be allocated dynamically. It greatly reduces the size of struct omap_hsmmc_plat. This is useful in cases where the board level code declares one or two struct omap_hsmmc_plat because it doesn't use the Driver Model. This saves around 740 bytes for the am335x_evm SPL. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Tested-by: Adam Ford <aford173@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
committed by
Jaehoon Chung
parent
76584e3398
commit
45530e3943
@@ -67,7 +67,7 @@ struct hsmmc {
|
|||||||
struct omap_hsmmc_plat {
|
struct omap_hsmmc_plat {
|
||||||
struct mmc_config cfg;
|
struct mmc_config cfg;
|
||||||
struct hsmmc *base_addr;
|
struct hsmmc *base_addr;
|
||||||
struct mmc mmc;
|
struct mmc *mmc;
|
||||||
bool cd_inverted;
|
bool cd_inverted;
|
||||||
u32 controller_flags;
|
u32 controller_flags;
|
||||||
const char *hw_rev;
|
const char *hw_rev;
|
||||||
|
@@ -1858,8 +1858,8 @@ static int omap_hsmmc_ofdata_to_platdata(struct udevice *dev)
|
|||||||
static int omap_hsmmc_bind(struct udevice *dev)
|
static int omap_hsmmc_bind(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct omap_hsmmc_plat *plat = dev_get_platdata(dev);
|
struct omap_hsmmc_plat *plat = dev_get_platdata(dev);
|
||||||
|
plat->mmc = calloc(1, sizeof(struct mmc));
|
||||||
return mmc_bind(dev, &plat->mmc, &plat->cfg);
|
return mmc_bind(dev, plat->mmc, &plat->cfg);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
static int omap_hsmmc_probe(struct udevice *dev)
|
static int omap_hsmmc_probe(struct udevice *dev)
|
||||||
@@ -1882,7 +1882,7 @@ static int omap_hsmmc_probe(struct udevice *dev)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_BLK
|
#ifdef CONFIG_BLK
|
||||||
mmc = &plat->mmc;
|
mmc = plat->mmc;
|
||||||
#else
|
#else
|
||||||
mmc = mmc_create(cfg, priv);
|
mmc = mmc_create(cfg, priv);
|
||||||
if (mmc == NULL)
|
if (mmc == NULL)
|
||||||
|
Reference in New Issue
Block a user