diff mbox series

[U-Boot,v4,6/9] mmc: arm_pl180_mmci: Remove cd_inverted host's struct field

Message ID 1532533752-15200-7-git-send-email-patrice.chotard@st.com
State Accepted
Delegated to: Tom Rini
Headers show
Series Add support of CONFIG_BLK for STM32Fx platforms | expand

Commit Message

Patrice CHOTARD July 25, 2018, 3:49 p.m. UTC
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>
---

Changes in v4:
  - update board DTS files to remove cd_inverted property
    and update cd-gpios active level

Changes in v3:
  - remove usage of "cd_inverted" DT property in dm_mmc_getcd()

Changes in v2: None

 drivers/mmc/arm_pl180_mmci.c | 5 +----
 drivers/mmc/arm_pl180_mmci.h | 1 -
 2 files changed, 1 insertion(+), 5 deletions(-)

Comments

Tom Rini Aug. 4, 2018, 11:40 p.m. UTC | #1
On Wed, Jul 25, 2018 at 05:49:09PM +0200, Patrice Chotard wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
index 1cd780b3eec0..f71d79ecd6ba 100644
--- a/drivers/mmc/arm_pl180_mmci.c
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -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;
 }
diff --git a/drivers/mmc/arm_pl180_mmci.h b/drivers/mmc/arm_pl180_mmci.h
index 6b98db6cd978..36487be288b2 100644
--- a/drivers/mmc/arm_pl180_mmci.h
+++ b/drivers/mmc/arm_pl180_mmci.h
@@ -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
 };