mmc: arm_pl180_mmci: Remove cd_inverted host's struct field
authorPatrice Chotard <patrice.chotard@st.com>
Wed, 25 Jul 2018 15:49:09 +0000 (17:49 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 3 Aug 2018 23:53:54 +0000 (19:53 -0400)
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>
drivers/mmc/arm_pl180_mmci.c
drivers/mmc/arm_pl180_mmci.h

index 1cd780b..f71d79e 100644 (file)
@@ -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;
 }
index 6b98db6..36487be 100644 (file)
@@ -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
 };