diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2017-05-19 15:31:50 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-06-20 10:30:21 +0200 |
commit | 10c998ef97278c803edd9e2297113896436ef3c8 (patch) | |
tree | f324a64cb62ced1acb8767dbf153c29fffab98eb /drivers/mmc/host | |
parent | e1df7ae30b430a3183d2a0a9b3e0b802f9d5ff49 (diff) |
mmc: tmio: make tmio_mmc_request function more readable
This part confused me and I had to read it twice until I got it. Let's
follow the standard pattern to bail out if something is wrong and keep
in the body of the function when everything is as expected.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/tmio_mmc_core.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index a649a5ff9957..5f5a4a2d81be 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -926,11 +926,12 @@ static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) } ret = tmio_mmc_start_command(host, mrq->cmd); - if (!ret) { - schedule_delayed_work(&host->delayed_reset_work, - msecs_to_jiffies(CMDREQ_TIMEOUT)); - return; - } + if (ret) + goto fail; + + schedule_delayed_work(&host->delayed_reset_work, + msecs_to_jiffies(CMDREQ_TIMEOUT)); + return; fail: host->force_pio = false; |