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>
This commit is contained in:
@ -214,7 +214,9 @@ static int sdio_card_irq_put(struct mmc_card *card)
|
||||
struct mmc_host *host = card->host;
|
||||
|
||||
WARN_ON(!host->claimed);
|
||||
BUG_ON(host->sdio_irqs < 1);
|
||||
|
||||
if (host->sdio_irqs < 1)
|
||||
return -EINVAL;
|
||||
|
||||
if (!--host->sdio_irqs) {
|
||||
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)
|
||||
int ret;
|
||||
unsigned char reg;
|
||||
|
||||
BUG_ON(!func);
|
||||
BUG_ON(!func->card);
|
||||
if (!func)
|
||||
return -EINVAL;
|
||||
|
||||
pr_debug("SDIO: Enabling IRQ for %s...\n", sdio_func_id(func));
|
||||
|
||||
@ -304,8 +306,8 @@ int sdio_release_irq(struct sdio_func *func)
|
||||
int ret;
|
||||
unsigned char reg;
|
||||
|
||||
BUG_ON(!func);
|
||||
BUG_ON(!func->card);
|
||||
if (!func)
|
||||
return -EINVAL;
|
||||
|
||||
pr_debug("SDIO: Disabling IRQ for %s...\n", sdio_func_id(func));
|
||||
|
||||
|
Reference in New Issue
Block a user