Skip to content

Commit

Permalink
mmc: core: Don't panic when fetching EXT_CSD
Browse files Browse the repository at this point in the history
Instead of doing BUG_ON(), return an error code.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Ulf Hansson committed Nov 10, 2014
1 parent c197787 commit 2fd322a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ static int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd)
int err;
u8 *ext_csd;

BUG_ON(!card);
BUG_ON(!new_ext_csd);
if (!card || !new_ext_csd)
return -EINVAL;

if (!mmc_can_ext_csd(card))
return -EOPNOTSUPP;
Expand Down Expand Up @@ -368,8 +368,6 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
int err = 0, idx;
unsigned int part_size;

BUG_ON(!card);

/* Version is coded in the CSD_STRUCTURE byte in the EXT_CSD register */
card->ext_csd.raw_ext_csd_structure = ext_csd[EXT_CSD_STRUCTURE];
if (card->csd.structure == 3) {
Expand Down

0 comments on commit 2fd322a

Please sign in to comment.