diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2017-06-08 15:27:43 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-06-20 10:30:45 +0200 |
commit | a1473732507499ec4002ad8cd33e645579d61a26 (patch) | |
tree | 7519050ad515472e502abb3d930e7820a98818a0 /drivers/mmc/core/mmc_ops.c | |
parent | mmc: core: Remove redundant code in mmc_send_cid() (diff) | |
download | linux-dev-a1473732507499ec4002ad8cd33e645579d61a26.tar.xz linux-dev-a1473732507499ec4002ad8cd33e645579d61a26.zip |
mmc: core: Re-factor code for sending CID
Instead of having the caller to check for SPI mode, let's leave that to
internals of mmc_send_cid(). In this way the code gets cleaner and it
becomes clear what is specific to SPI and non-SPI mode.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Diffstat (limited to 'drivers/mmc/core/mmc_ops.c')
-rw-r--r-- | drivers/mmc/core/mmc_ops.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 2c4d9fd4b1c1..b92bfe85c671 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -207,7 +207,7 @@ int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) return err; } -int mmc_all_send_cid(struct mmc_host *host, u32 *cid) +static int mmc_all_send_cid(struct mmc_host *host, u32 *cid) { int err; struct mmc_command cmd = {}; @@ -334,7 +334,7 @@ err: return ret; } -int mmc_send_cid(struct mmc_host *host, u32 *cid) +static int mmc_spi_send_cid(struct mmc_host *host, u32 *cid) { int ret, i; __be32 *cid_tmp; @@ -355,6 +355,14 @@ err: return ret; } +int mmc_send_cid(struct mmc_host *host, u32 *cid) +{ + if (mmc_host_is_spi(host)) + return mmc_spi_send_cid(host, cid); + + return mmc_all_send_cid(host, cid); +} + int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd) { int err; |