diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2017-06-08 09:27:45 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-06-20 04:30:47 -0400 |
commit | 0796e439c5cc4ceeb84e08479c5ee1a4ebab5549 (patch) | |
tree | 896eac7efed2605dfe47a10aaf00c43d9f454344 /drivers/mmc/core/mmc_ops.c | |
parent | c92e68d8a6595fec3e1f778edb4760507aef18d2 (diff) |
mmc: core: Clarify code for sending CSD
To make the code more consistent and to increase readability, add an
mmc_spi_send_csd() function, which gets called from mmc_send_csd() in case
of 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 | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 46c80f829936..5f7c5920231a 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c | |||
@@ -291,15 +291,11 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host, | |||
291 | return 0; | 291 | return 0; |
292 | } | 292 | } |
293 | 293 | ||
294 | int mmc_send_csd(struct mmc_card *card, u32 *csd) | 294 | static int mmc_spi_send_csd(struct mmc_card *card, u32 *csd) |
295 | { | 295 | { |
296 | int ret, i; | 296 | int ret, i; |
297 | __be32 *csd_tmp; | 297 | __be32 *csd_tmp; |
298 | 298 | ||
299 | if (!mmc_host_is_spi(card->host)) | ||
300 | return mmc_send_cxd_native(card->host, card->rca << 16, | ||
301 | csd, MMC_SEND_CSD); | ||
302 | |||
303 | csd_tmp = kzalloc(16, GFP_KERNEL); | 299 | csd_tmp = kzalloc(16, GFP_KERNEL); |
304 | if (!csd_tmp) | 300 | if (!csd_tmp) |
305 | return -ENOMEM; | 301 | return -ENOMEM; |
@@ -316,6 +312,15 @@ err: | |||
316 | return ret; | 312 | return ret; |
317 | } | 313 | } |
318 | 314 | ||
315 | int mmc_send_csd(struct mmc_card *card, u32 *csd) | ||
316 | { | ||
317 | if (mmc_host_is_spi(card->host)) | ||
318 | return mmc_spi_send_csd(card, csd); | ||
319 | |||
320 | return mmc_send_cxd_native(card->host, card->rca << 16, csd, | ||
321 | MMC_SEND_CSD); | ||
322 | } | ||
323 | |||
319 | static int mmc_spi_send_cid(struct mmc_host *host, u32 *cid) | 324 | static int mmc_spi_send_cid(struct mmc_host *host, u32 *cid) |
320 | { | 325 | { |
321 | int ret, i; | 326 | int ret, i; |