mmc: arm_pl180_mmci: Remove cd_inverted host's struct field

As platform uses GPIOs for card detection, it's
simpler and more readable to use GPIO_ACTIVE_(LOW|HIGH)
in the gpio flags instead of using the cd-inverted
property.

Reported-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
lime2-spi
Patrice Chotard 6 years ago committed by Tom Rini
parent 43d36a0bae
commit fa91156165
  1. 5
      drivers/mmc/arm_pl180_mmci.c
  2. 1
      drivers/mmc/arm_pl180_mmci.h

@ -499,11 +499,8 @@ static int dm_mmc_getcd(struct udevice *dev)
struct pl180_mmc_host *host = dev->priv;
int value = 1;
if (dm_gpio_is_valid(&host->cd_gpio)) {
if (dm_gpio_is_valid(&host->cd_gpio))
value = dm_gpio_get_value(&host->cd_gpio);
if (host->cd_inverted)
return !value;
}
return value;
}

@ -192,7 +192,6 @@ struct pl180_mmc_host {
struct mmc_config cfg;
#ifdef CONFIG_DM_MMC
struct gpio_desc cd_gpio;
bool cd_inverted;
#endif
};

Loading…
Cancel
Save