diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c index cc40732c30cc..d9e22cf40f77 100644 --- a/sound/soc/sdca/sdca_interrupts.c +++ b/sound/soc/sdca/sdca_interrupts.c @@ -198,6 +198,18 @@ static irqreturn_t hid_handler(int irq, void *data) return irqret; } +#ifdef CONFIG_PM_SLEEP +static bool no_pm_in_progress(struct device *dev) +{ + return completion_done(&dev->power.completion); +} +#else +static bool no_pm_in_progress(struct device *dev) +{ + return true; +} +#endif + static irqreturn_t fdl_owner_handler(int irq, void *data) { struct sdca_interrupt *interrupt = data; @@ -209,7 +221,7 @@ static irqreturn_t fdl_owner_handler(int irq, void *data) * FDL has to run from the system resume handler, at which point * we can't wait for the pm runtime. */ - if (completion_done(&dev->power.completion)) { + if (no_pm_in_progress(dev)) { ret = pm_runtime_get_sync(dev); if (ret < 0) { dev_err(dev, "failed to resume for fdl: %d\n", ret); @@ -223,7 +235,7 @@ static irqreturn_t fdl_owner_handler(int irq, void *data) irqret = IRQ_HANDLED; error: - if (completion_done(&dev->power.completion)) + if (no_pm_in_progress(dev)) pm_runtime_put(dev); return irqret; }