mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
ASoC: SDCA: Handle CONFIG_PM_SLEEP not being set
If CONFIG_PM_SLEEP is not set the completion used will not exist. Update
the code to avoid the build error this introduces, without PM_SLEEP it
should be safe to always run the conditional code.
Fixes: ffd7e8a101 ("ASoC: SDCA: Device boot into the system suspend process")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601151803.XY7KryHC-lkp@intel.com/
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260115141107.564929-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
60e8451be1
commit
7a3d1b04d9
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user