summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/core.c
diff options
context:
space:
mode:
authorUlf Hansson2014-10-17 11:48:23 +0200
committerUlf Hansson2014-11-10 12:40:44 +0100
commitb2cada73a8ff2ee9129557c724f7e53bf55e48f8 (patch)
treece7635c42deb4bccc58e33e071359ad9c8ecc6d5 /drivers/mmc/core/core.c
parentmmc: block: Use mmc_get_ext_csd() instead of mmc_send_ext_csd() (diff)
downloadkernel-qcow2-linux-b2cada73a8ff2ee9129557c724f7e53bf55e48f8.tar.gz
kernel-qcow2-linux-b2cada73a8ff2ee9129557c724f7e53bf55e48f8.tar.xz
kernel-qcow2-linux-b2cada73a8ff2ee9129557c724f7e53bf55e48f8.zip
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.c17
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)
int err;
u8 *ext_csd;
- /*
- * In future work, we should consider storing the entire ext_csd.
- */
- ext_csd = kmalloc(512, GFP_KERNEL);
- if (!ext_csd) {
- pr_err("%s: could not allocate buffer to receive the ext_csd.\n",
- mmc_hostname(card->host));
- return -ENOMEM;
- }
-
mmc_claim_host(card->host);
- err = mmc_send_ext_csd(card, ext_csd);
+ err = mmc_get_ext_csd(card, &ext_csd);
mmc_release_host(card->host);
if (err)
- goto out;
+ return err;
card->ext_csd.raw_bkops_status = ext_csd[EXT_CSD_BKOPS_STATUS];
card->ext_csd.raw_exception_status = ext_csd[EXT_CSD_EXP_EVENTS_STATUS];
-out:
kfree(ext_csd);
- return err;
+ return 0;
}
EXPORT_SYMBOL(mmc_read_bkops_status);