[U-Boot] [PATCH 07/13] mmc: tmio: Improve error handling
Masahiro Yamada
yamada.masahiro at socionext.com
Thu Nov 1 11:43:50 UTC 2018
On Thu, Nov 1, 2018 at 2:25 AM Marek Vasut <marek.vasut at gmail.com> wrote:
>
> 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 at gmail.com>
> Cc: Masahiro Yamada <yamada.masahiro at socionext.com>
> ---
Good catch! Thanks.
> drivers/mmc/tmio-common.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/tmio-common.c b/drivers/mmc/tmio-common.c
> index c8caa0fb18..8e83584e57 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,
> --
> 2.18.0
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
--
Best Regards
Masahiro Yamada
More information about the U-Boot
mailing list