All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kontron-pitx-imx8m: fix board_mmc_getcd()
@ 2022-02-16 14:58 Heiko Thiery
  2022-02-20  9:08 ` sbabic
  0 siblings, 1 reply; 2+ messages in thread
From: Heiko Thiery @ 2022-02-16 14:58 UTC (permalink / raw)
  To: u-boot; +Cc: Michael Walle, Heiko Thiery

The function wrongly will return the card detection status of the SD card
(USDHC2) for the eMMC (USDHC1). Thus booting from eMMC without an inserted
SD card will fail.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
 board/kontron/pitx_imx8m/spl.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/board/kontron/pitx_imx8m/spl.c b/board/kontron/pitx_imx8m/spl.c
index c043dd205b..ef3256898d 100644
--- a/board/kontron/pitx_imx8m/spl.c
+++ b/board/kontron/pitx_imx8m/spl.c
@@ -76,17 +76,16 @@ static struct i2c_pads_info i2c_pad_info1 = {
 int board_mmc_getcd(struct mmc *mmc)
 {
 	struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
-	int ret = 0;
 
 	switch (cfg->esdhc_base) {
 	case USDHC1_BASE_ADDR:
 		/* the eMMC does not have a CD pin */
-		ret = 1;
+		return 1;
 	case USDHC2_BASE_ADDR:
-		ret = !gpio_get_value(USDHC2_CD_GPIO);
+		return !gpio_get_value(USDHC2_CD_GPIO);
 	}
 
-	return ret;
+	return 0;
 }
 
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] kontron-pitx-imx8m: fix board_mmc_getcd()
  2022-02-16 14:58 [PATCH] kontron-pitx-imx8m: fix board_mmc_getcd() Heiko Thiery
@ 2022-02-20  9:08 ` sbabic
  0 siblings, 0 replies; 2+ messages in thread
From: sbabic @ 2022-02-20  9:08 UTC (permalink / raw)
  To: Heiko Thiery, u-boot

> The function wrongly will return the card detection status of the SD card
> (USDHC2) for the eMMC (USDHC1). Thus booting from eMMC without an inserted
> SD card will fail.
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-20  9:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 14:58 [PATCH] kontron-pitx-imx8m: fix board_mmc_getcd() Heiko Thiery
2022-02-20  9:08 ` sbabic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.