Skip to content

Commit

Permalink
mmc: replace BUG_ON with WARN_ON
Browse files Browse the repository at this point in the history
Replace all cases of BUG_ON with WARN_ON where there is a chance
(with varying degrees of slim) that the kernel can continue without
incidence.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
  • Loading branch information
Pierre Ossman committed Sep 23, 2007
1 parent 9f2fcf9 commit d84075c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
12 changes: 6 additions & 6 deletions drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries
{
struct mmc_request mrq;

BUG_ON(!host->claimed);
WARN_ON(!host->claimed);

memset(&mrq, 0, sizeof(struct mmc_request));

Expand Down Expand Up @@ -333,7 +333,7 @@ void mmc_release_host(struct mmc_host *host)
{
unsigned long flags;

BUG_ON(!host->claimed);
WARN_ON(!host->claimed);

spin_lock_irqsave(&host->lock, flags);
host->claimed = 0;
Expand Down Expand Up @@ -531,7 +531,7 @@ void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops)
BUG_ON(!host);
BUG_ON(!ops);

BUG_ON(!host->claimed);
WARN_ON(!host->claimed);

spin_lock_irqsave(&host->lock, flags);

Expand All @@ -555,8 +555,8 @@ void mmc_detach_bus(struct mmc_host *host)

BUG_ON(!host);

BUG_ON(!host->claimed);
BUG_ON(!host->bus_ops);
WARN_ON(!host->claimed);
WARN_ON(!host->bus_ops);

spin_lock_irqsave(&host->lock, flags);

Expand Down Expand Up @@ -584,7 +584,7 @@ void mmc_detect_change(struct mmc_host *host, unsigned long delay)
#ifdef CONFIG_MMC_DEBUG
unsigned long flags;
spin_lock_irqsave(&host->lock, flags);
BUG_ON(host->removed);
WARN_ON(host->removed);
spin_unlock_irqrestore(&host->lock, flags);
#endif

Expand Down
4 changes: 2 additions & 2 deletions drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
unsigned int max_dtr;

BUG_ON(!host);
BUG_ON(!host->claimed);
WARN_ON(!host->claimed);

/*
* Since we're changing the OCR value, we seem to
Expand Down Expand Up @@ -558,7 +558,7 @@ int mmc_attach_mmc(struct mmc_host *host, u32 ocr)
int err;

BUG_ON(!host);
BUG_ON(!host->claimed);
WARN_ON(!host->claimed);

mmc_attach_bus(host, &mmc_ops);

Expand Down
6 changes: 2 additions & 4 deletions drivers/mmc/core/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ static int mmc_decode_scr(struct mmc_card *card)
unsigned int scr_struct;
u32 resp[4];

BUG_ON(!mmc_card_sd(card));

resp[3] = card->raw_scr[1];
resp[2] = card->raw_scr[0];

Expand Down Expand Up @@ -300,7 +298,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
unsigned int max_dtr;

BUG_ON(!host);
BUG_ON(!host->claimed);
WARN_ON(!host->claimed);

/*
* Since we're changing the OCR value, we seem to
Expand Down Expand Up @@ -620,7 +618,7 @@ int mmc_attach_sd(struct mmc_host *host, u32 ocr)
int err;

BUG_ON(!host);
BUG_ON(!host->claimed);
WARN_ON(!host->claimed);

mmc_attach_bus(host, &mmc_sd_ops);

Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/core/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
struct mmc_card *card;

BUG_ON(!host);
BUG_ON(!host->claimed);
WARN_ON(!host->claimed);

mmc_attach_bus(host, &mmc_sdio_ops);

Expand Down
4 changes: 2 additions & 2 deletions drivers/mmc/core/sdio_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static int sdio_card_irq_get(struct mmc_card *card)
{
struct mmc_host *host = card->host;

BUG_ON(!host->claimed);
WARN_ON(!host->claimed);

if (!host->sdio_irqs++) {
atomic_set(&host->sdio_irq_thread_abort, 0);
Expand All @@ -145,7 +145,7 @@ static int sdio_card_irq_put(struct mmc_card *card)
{
struct mmc_host *host = card->host;

BUG_ON(!host->claimed);
WARN_ON(!host->claimed);
BUG_ON(host->sdio_irqs < 1);

if (!--host->sdio_irqs) {
Expand Down

0 comments on commit d84075c

Please sign in to comment.