diff mbox series

[U-Boot,V3,02/13] mmc: tmio: Improve error handling

Message ID 20181102150328.21972-2-marek.vasut+renesas@gmail.com
State Deferred
Delegated to: Peng Fan
Headers show
Series [U-Boot,V3,01/13] mmc: tmio: Simplify pinmux handling | expand

Commit Message

Marek Vasut Nov. 2, 2018, 3:03 p.m. UTC
Properly handle return values and abort operations when they are
non-zero. This is a minor improvement, which fixes two remaining
unchecked return values.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
---
V2: No change
V3: No change
---
 drivers/mmc/tmio-common.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/mmc/tmio-common.c b/drivers/mmc/tmio-common.c
index 5f927c6150..f1ce019db5 100644
--- a/drivers/mmc/tmio-common.c
+++ b/drivers/mmc/tmio-common.c
@@ -498,6 +498,8 @@  int tmio_sd_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 			ret = tmio_sd_dma_xfer(dev, data);
 		else
 			ret = tmio_sd_pio_xfer(dev, data);
+		if (ret)
+			return ret;
 
 		ret = tmio_sd_wait_for_irq(dev, TMIO_SD_INFO1,
 					       TMIO_SD_INFO1_CMP);
@@ -505,9 +507,8 @@  int tmio_sd_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 			return ret;
 	}
 
-	tmio_sd_wait_for_irq(dev, TMIO_SD_INFO2, TMIO_SD_INFO2_SCLKDIVEN);
-
-	return ret;
+	return tmio_sd_wait_for_irq(dev, TMIO_SD_INFO2,
+				    TMIO_SD_INFO2_SCLKDIVEN);
 }
 
 static int tmio_sd_set_bus_width(struct tmio_sd_priv *priv,