From: Sekhar Nori Date: Wed, 10 Aug 2016 13:54:03 +0000 (+0530) Subject: drivers: mmc: omap_hsmmc: fix build breakage X-Git-Tag: v2016.09-rc2~37 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4de2de5149a0361fa62e5751ed05691d497844c5;p=u-boot drivers: mmc: omap_hsmmc: fix build breakage structure member 'cd_inverted' of omap_hsmmc_data is available only when OMAP_HSMMC_USE_GPIO is defined. When CONFIG_DM_MMC is defined, but not CONFIG_OMAP_GPIO, this will cause build breakage in omap_hsmmc driver of the sort: CC drivers/mmc/omap_hsmmc.o ../drivers/mmc/omap_hsmmc.c: In function 'omap_hsmmc_ofdata_to_platdata': ../drivers/mmc/omap_hsmmc.c:1763:6: error: 'struct omap_hsmmc_data' has no member named 'cd_inverted' priv->cd_inverted = fdtdec_get_bool(fdt, node, "cd-inverted"); ^ Fix this by accessing cd_inverted only when OMAP_HSMMC_USE_GPIO is defined. Signed-off-by: Sekhar Nori Acked-by: Mugunthan V N Reviewed-by: Tom Rini --- diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index e80ac3d722..fceafe1f15 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -801,7 +801,9 @@ static int omap_hsmmc_ofdata_to_platdata(struct udevice *dev) cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; +#ifdef OMAP_HSMMC_USE_GPIO priv->cd_inverted = fdtdec_get_bool(fdt, node, "cd-inverted"); +#endif return 0; }