]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mmc: block: return errorcode from mmc_sd_num_wr_blocks()
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 1 Feb 2017 12:47:57 +0000 (13:47 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 14 Feb 2017 08:07:59 +0000 (09:07 +0100)
commit169f03a064c230de6d715bdd62112eb12256fce3
tree237a211bce3b429b0511040dac6f80b2cb33fe23
parent9491be5ff06ff08d61e6a8d767382ea0037a6f38
mmc: block: return errorcode from mmc_sd_num_wr_blocks()

mmc_sd_num_wr_blocks() has an interesting construction that
saves one return argument by casting (u32)-1 as error code
if something goes wrong.

This is however a bit confusing when the normal kernel
pattern is to return an int error code on success.

So instead pass a variable "blocks" that the function can
fill in with the number of successfully transferred blocks
and return an integer as error code.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
[Ulf: Changed a return code to -EIO, reported by Dan Carpenter and fixed
by Linus Walleij]
drivers/mmc/core/block.c