Skip to content

Commit c48941f

Browse files
committed
mmc: litex_mmc: disable interrupts when driver removed
Signed-off-by: Gabriel Somlo <[email protected]>
1 parent bb45e80 commit c48941f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/mmc/host/litex_mmc.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,11 @@ static const struct mmc_host_ops litex_mmc_ops = {
469469
.set_ios = litex_mmc_set_ios,
470470
};
471471

472+
static void litex_mmc_irq_off(void *sdirq)
473+
{
474+
litex_write32((void __iomem *)sdirq + LITEX_IRQ_ENABLE, 0);
475+
}
476+
472477
static int litex_mmc_irq_init(struct platform_device *pdev,
473478
struct litex_mmc_host *host)
474479
{
@@ -496,6 +501,11 @@ static int litex_mmc_irq_init(struct platform_device *pdev,
496501
goto use_polling;
497502
}
498503

504+
ret = devm_add_action_or_reset(dev, litex_mmc_irq_off, host->sdirq);
505+
if (ret)
506+
return dev_err_probe(dev, ret,
507+
"Can't register irq_off action\n");
508+
499509
/* Clear & enable interrupts */
500510
litex_write32(host->sdirq + LITEX_IRQ_PENDING,
501511
SDIRQ_CARD_DETECT | SDIRQ_CMD_DONE);

0 commit comments

Comments
 (0)