aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sdio_irq.c
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2016-11-02 03:24:00 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2016-12-05 04:31:08 -0500
commit5df0e8231f9518ee5ca3f58a0777556dd03addd6 (patch)
tree10824ce4a1a4dd724752600d94ac3518ec6b0f91 /drivers/mmc/core/sdio_irq.c
parent925ff3a7a334b3fe968ae15f07d22df21addad26 (diff)
mmc: core: remove BUG_ONs from sdio
BUG_ONs doesn't help anything except for stop the system from running. If it occurs, it implies we should deploy proper error handling for that. So this patch is gonna discard these meaningless BUG_ONs and deploy error handling if needed. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/sdio_irq.c')
-rw-r--r--drivers/mmc/core/sdio_irq.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index 91bbbfb29f3f..f1faf9acc007 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -214,7 +214,9 @@ static int sdio_card_irq_put(struct mmc_card *card)
214 struct mmc_host *host = card->host; 214 struct mmc_host *host = card->host;
215 215
216 WARN_ON(!host->claimed); 216 WARN_ON(!host->claimed);
217 BUG_ON(host->sdio_irqs < 1); 217
218 if (host->sdio_irqs < 1)
219 return -EINVAL;
218 220
219 if (!--host->sdio_irqs) { 221 if (!--host->sdio_irqs) {
220 if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD)) { 222 if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD)) {
@@ -261,8 +263,8 @@ int sdio_claim_irq(struct sdio_func *func, sdio_irq_handler_t *handler)
261 int ret; 263 int ret;
262 unsigned char reg; 264 unsigned char reg;
263 265
264 BUG_ON(!func); 266 if (!func)
265 BUG_ON(!func->card); 267 return -EINVAL;
266 268
267 pr_debug("SDIO: Enabling IRQ for %s...\n", sdio_func_id(func)); 269 pr_debug("SDIO: Enabling IRQ for %s...\n", sdio_func_id(func));
268 270
@@ -304,8 +306,8 @@ int sdio_release_irq(struct sdio_func *func)
304 int ret; 306 int ret;
305 unsigned char reg; 307 unsigned char reg;
306 308
307 BUG_ON(!func); 309 if (!func)
308 BUG_ON(!func->card); 310 return -EINVAL;
309 311
310 pr_debug("SDIO: Disabling IRQ for %s...\n", sdio_func_id(func)); 312 pr_debug("SDIO: Disabling IRQ for %s...\n", sdio_func_id(func));
311 313