diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2014-10-17 05:48:23 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2014-11-10 06:40:44 -0500 |
commit | b2cada73a8ff2ee9129557c724f7e53bf55e48f8 (patch) | |
tree | ce7635c42deb4bccc58e33e071359ad9c8ecc6d5 /drivers/mmc/core/core.c | |
parent | 86817ffb492b509b87b20be4a4f1afc74f04dccf (diff) |
mmc: core: Use mmc_get_ext_csd() instead of mmc_send_ext_csd()
By using mmc_get_ext_csd() in favor of mmc_send_ext_csd, we decrease
code duplication.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r-- | drivers/mmc/core/core.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 953f17c5fcde..943f9051ec6d 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -731,27 +731,16 @@ int mmc_read_bkops_status(struct mmc_card *card) | |||
731 | int err; | 731 | int err; |
732 | u8 *ext_csd; | 732 | u8 *ext_csd; |
733 | 733 | ||
734 | /* | ||
735 | * In future work, we should consider storing the entire ext_csd. | ||
736 | */ | ||
737 | ext_csd = kmalloc(512, GFP_KERNEL); | ||
738 | if (!ext_csd) { | ||
739 | pr_err("%s: could not allocate buffer to receive the ext_csd.\n", | ||
740 | mmc_hostname(card->host)); | ||
741 | return -ENOMEM; | ||
742 | } | ||
743 | |||
744 | mmc_claim_host(card->host); | 734 | mmc_claim_host(card->host); |
745 | err = mmc_send_ext_csd(card, ext_csd); | 735 | err = mmc_get_ext_csd(card, &ext_csd); |
746 | mmc_release_host(card->host); | 736 | mmc_release_host(card->host); |
747 | if (err) | 737 | if (err) |
748 | goto out; | 738 | return err; |
749 | 739 | ||
750 | card->ext_csd.raw_bkops_status = ext_csd[EXT_CSD_BKOPS_STATUS]; | 740 | card->ext_csd.raw_bkops_status = ext_csd[EXT_CSD_BKOPS_STATUS]; |
751 | card->ext_csd.raw_exception_status = ext_csd[EXT_CSD_EXP_EVENTS_STATUS]; | 741 | card->ext_csd.raw_exception_status = ext_csd[EXT_CSD_EXP_EVENTS_STATUS]; |
752 | out: | ||
753 | kfree(ext_csd); | 742 | kfree(ext_csd); |
754 | return err; | 743 | return 0; |
755 | } | 744 | } |
756 | EXPORT_SYMBOL(mmc_read_bkops_status); | 745 | EXPORT_SYMBOL(mmc_read_bkops_status); |
757 | 746 | ||