aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2007-08-09 07:23:56 -0400
committerPierre Ossman <drzeus@drzeus.cx>2007-09-23 15:23:07 -0400
commitd84075c8aed771d47d7ac6e96b098559da361c25 (patch)
tree6c2457a49240cb6c116f0b50340be3644fc10936 /drivers/mmc/core
parent9f2fcf99394b34769e3243a7f42a0ba8d21fc774 (diff)
mmc: replace BUG_ON with WARN_ON
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>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/core.c12
-rw-r--r--drivers/mmc/core/mmc.c4
-rw-r--r--drivers/mmc/core/sd.c6
-rw-r--r--drivers/mmc/core/sdio.c2
-rw-r--r--drivers/mmc/core/sdio_irq.c4
5 files changed, 13 insertions, 15 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 9d29bed820a1..3bebd3b55dc5 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -202,7 +202,7 @@ int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries
202{ 202{
203 struct mmc_request mrq; 203 struct mmc_request mrq;
204 204
205 BUG_ON(!host->claimed); 205 WARN_ON(!host->claimed);
206 206
207 memset(&mrq, 0, sizeof(struct mmc_request)); 207 memset(&mrq, 0, sizeof(struct mmc_request));
208 208
@@ -333,7 +333,7 @@ void mmc_release_host(struct mmc_host *host)
333{ 333{
334 unsigned long flags; 334 unsigned long flags;
335 335
336 BUG_ON(!host->claimed); 336 WARN_ON(!host->claimed);
337 337
338 spin_lock_irqsave(&host->lock, flags); 338 spin_lock_irqsave(&host->lock, flags);
339 host->claimed = 0; 339 host->claimed = 0;
@@ -531,7 +531,7 @@ void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops)
531 BUG_ON(!host); 531 BUG_ON(!host);
532 BUG_ON(!ops); 532 BUG_ON(!ops);
533 533
534 BUG_ON(!host->claimed); 534 WARN_ON(!host->claimed);
535 535
536 spin_lock_irqsave(&host->lock, flags); 536 spin_lock_irqsave(&host->lock, flags);
537 537
@@ -555,8 +555,8 @@ void mmc_detach_bus(struct mmc_host *host)
555 555
556 BUG_ON(!host); 556 BUG_ON(!host);
557 557
558 BUG_ON(!host->claimed); 558 WARN_ON(!host->claimed);
559 BUG_ON(!host->bus_ops); 559 WARN_ON(!host->bus_ops);
560 560
561 spin_lock_irqsave(&host->lock, flags); 561 spin_lock_irqsave(&host->lock, flags);
562 562
@@ -584,7 +584,7 @@ void mmc_detect_change(struct mmc_host *host, unsigned long delay)
584#ifdef CONFIG_MMC_DEBUG 584#ifdef CONFIG_MMC_DEBUG
585 unsigned long flags; 585 unsigned long flags;
586 spin_lock_irqsave(&host->lock, flags); 586 spin_lock_irqsave(&host->lock, flags);
587 BUG_ON(host->removed); 587 WARN_ON(host->removed);
588 spin_unlock_irqrestore(&host->lock, flags); 588 spin_unlock_irqrestore(&host->lock, flags);
589#endif 589#endif
590 590
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index ba7a847cfd08..6ba458951d24 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -264,7 +264,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
264 unsigned int max_dtr; 264 unsigned int max_dtr;
265 265
266 BUG_ON(!host); 266 BUG_ON(!host);
267 BUG_ON(!host->claimed); 267 WARN_ON(!host->claimed);
268 268
269 /* 269 /*
270 * Since we're changing the OCR value, we seem to 270 * Since we're changing the OCR value, we seem to
@@ -558,7 +558,7 @@ int mmc_attach_mmc(struct mmc_host *host, u32 ocr)
558 int err; 558 int err;
559 559
560 BUG_ON(!host); 560 BUG_ON(!host);
561 BUG_ON(!host->claimed); 561 WARN_ON(!host->claimed);
562 562
563 mmc_attach_bus(host, &mmc_ops); 563 mmc_attach_bus(host, &mmc_ops);
564 564
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 0a04a6e86ca1..c86588fdaae5 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -166,8 +166,6 @@ static int mmc_decode_scr(struct mmc_card *card)
166 unsigned int scr_struct; 166 unsigned int scr_struct;
167 u32 resp[4]; 167 u32 resp[4];
168 168
169 BUG_ON(!mmc_card_sd(card));
170
171 resp[3] = card->raw_scr[1]; 169 resp[3] = card->raw_scr[1];
172 resp[2] = card->raw_scr[0]; 170 resp[2] = card->raw_scr[0];
173 171
@@ -300,7 +298,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
300 unsigned int max_dtr; 298 unsigned int max_dtr;
301 299
302 BUG_ON(!host); 300 BUG_ON(!host);
303 BUG_ON(!host->claimed); 301 WARN_ON(!host->claimed);
304 302
305 /* 303 /*
306 * Since we're changing the OCR value, we seem to 304 * Since we're changing the OCR value, we seem to
@@ -620,7 +618,7 @@ int mmc_attach_sd(struct mmc_host *host, u32 ocr)
620 int err; 618 int err;
621 619
622 BUG_ON(!host); 620 BUG_ON(!host);
623 BUG_ON(!host->claimed); 621 WARN_ON(!host->claimed);
624 622
625 mmc_attach_bus(host, &mmc_sd_ops); 623 mmc_attach_bus(host, &mmc_sd_ops);
626 624
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 58cf36e44678..2f3fb994c383 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -230,7 +230,7 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
230 struct mmc_card *card; 230 struct mmc_card *card;
231 231
232 BUG_ON(!host); 232 BUG_ON(!host);
233 BUG_ON(!host->claimed); 233 WARN_ON(!host->claimed);
234 234
235 mmc_attach_bus(host, &mmc_sdio_ops); 235 mmc_attach_bus(host, &mmc_sdio_ops);
236 236
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index 01daee934d16..8843a4c2fe91 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -125,7 +125,7 @@ static int sdio_card_irq_get(struct mmc_card *card)
125{ 125{
126 struct mmc_host *host = card->host; 126 struct mmc_host *host = card->host;
127 127
128 BUG_ON(!host->claimed); 128 WARN_ON(!host->claimed);
129 129
130 if (!host->sdio_irqs++) { 130 if (!host->sdio_irqs++) {
131 atomic_set(&host->sdio_irq_thread_abort, 0); 131 atomic_set(&host->sdio_irq_thread_abort, 0);
@@ -145,7 +145,7 @@ static int sdio_card_irq_put(struct mmc_card *card)
145{ 145{
146 struct mmc_host *host = card->host; 146 struct mmc_host *host = card->host;
147 147
148 BUG_ON(!host->claimed); 148 WARN_ON(!host->claimed);
149 BUG_ON(host->sdio_irqs < 1); 149 BUG_ON(host->sdio_irqs < 1);
150 150
151 if (!--host->sdio_irqs) { 151 if (!--host->sdio_irqs) {