Skip to content

Commit

Permalink
mmc: block: Use mmc_get_ext_csd() instead of mmc_send_ext_csd()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ulf Hansson committed Nov 10, 2014
1 parent e21aa51 commit 86817ff
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions drivers/mmc/card/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,19 +1309,11 @@ static int mmc_blk_packed_err_check(struct mmc_card *card,
}

if (status & R1_EXCEPTION_EVENT) {
ext_csd = kzalloc(512, GFP_KERNEL);
if (!ext_csd) {
pr_err("%s: unable to allocate buffer for ext_csd\n",
req->rq_disk->disk_name);
return -ENOMEM;
}

err = mmc_send_ext_csd(card, ext_csd);
err = mmc_get_ext_csd(card, &ext_csd);
if (err) {
pr_err("%s: error %d sending ext_csd\n",
req->rq_disk->disk_name, err);
check = MMC_BLK_ABORT;
goto free;
return MMC_BLK_ABORT;
}

if ((ext_csd[EXT_CSD_EXP_EVENTS_STATUS] &
Expand All @@ -1339,7 +1331,6 @@ static int mmc_blk_packed_err_check(struct mmc_card *card,
req->rq_disk->disk_name, packed->nr_entries,
packed->blocks, packed->idx_failure);
}
free:
kfree(ext_csd);
}

Expand Down

0 comments on commit 86817ff

Please sign in to comment.