aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2014-10-17 05:39:05 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-11-10 06:40:44 -0500
commit86817ffb492b509b87b20be4a4f1afc74f04dccf (patch)
treeca0c50929c51f90f300beee9e2c4057ecf12df10 /drivers/mmc/card
parente21aa519ee3667d0fabda5d806cc68826e9899e0 (diff)
mmc: block: 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/card')
-rw-r--r--drivers/mmc/card/block.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index f45f7e3870be..0c41ee043e36 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1309,19 +1309,11 @@ static int mmc_blk_packed_err_check(struct mmc_card *card,
1309 } 1309 }
1310 1310
1311 if (status & R1_EXCEPTION_EVENT) { 1311 if (status & R1_EXCEPTION_EVENT) {
1312 ext_csd = kzalloc(512, GFP_KERNEL); 1312 err = mmc_get_ext_csd(card, &ext_csd);
1313 if (!ext_csd) {
1314 pr_err("%s: unable to allocate buffer for ext_csd\n",
1315 req->rq_disk->disk_name);
1316 return -ENOMEM;
1317 }
1318
1319 err = mmc_send_ext_csd(card, ext_csd);
1320 if (err) { 1313 if (err) {
1321 pr_err("%s: error %d sending ext_csd\n", 1314 pr_err("%s: error %d sending ext_csd\n",
1322 req->rq_disk->disk_name, err); 1315 req->rq_disk->disk_name, err);
1323 check = MMC_BLK_ABORT; 1316 return MMC_BLK_ABORT;
1324 goto free;
1325 } 1317 }
1326 1318
1327 if ((ext_csd[EXT_CSD_EXP_EVENTS_STATUS] & 1319 if ((ext_csd[EXT_CSD_EXP_EVENTS_STATUS] &
@@ -1339,7 +1331,6 @@ static int mmc_blk_packed_err_check(struct mmc_card *card,
1339 req->rq_disk->disk_name, packed->nr_entries, 1331 req->rq_disk->disk_name, packed->nr_entries,
1340 packed->blocks, packed->idx_failure); 1332 packed->blocks, packed->idx_failure);
1341 } 1333 }
1342free:
1343 kfree(ext_csd); 1334 kfree(ext_csd);
1344 } 1335 }
1345 1336