From f38d43dafb0ccd85034fe22647d353ee8be03ab6 Mon Sep 17 00:00:00 2001 From: Cezary Rojewski Date: Wed, 7 Oct 2020 15:57:00 +0200 Subject: ASoC: Intel: catpt: Fix compilation when CONFIG_MODULES is disabled module_is_live() is available only when CONFIG_MODULES is enabled. Replace its usage with try_module_get() which is present regardless of said config's status. Fixes: 7a10b66a5df9 ("ASoC: Intel: catpt: Device driver lifecycle") Reported-by: Randy Dunlap Signed-off-by: Cezary Rojewski Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20201007135701.20372-1-cezary.rojewski@intel.com Signed-off-by: Mark Brown --- sound/soc/intel/catpt/device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/intel/catpt/device.c b/sound/soc/intel/catpt/device.c index 390ffb203de0..a70179959795 100644 --- a/sound/soc/intel/catpt/device.c +++ b/sound/soc/intel/catpt/device.c @@ -81,10 +81,11 @@ static int __maybe_unused catpt_resume(struct device *dev) if (ret) return ret; - if (!module_is_live(dev->driver->owner)) { + if (!try_module_get(dev->driver->owner)) { dev_info(dev, "module unloading, skipping fw boot\n"); return 0; } + module_put(dev->driver->owner); ret = catpt_boot_firmware(cdev, true); if (ret) { @@ -107,10 +108,12 @@ static int __maybe_unused catpt_resume(struct device *dev) static int __maybe_unused catpt_runtime_suspend(struct device *dev) { - if (!module_is_live(dev->driver->owner)) { + if (!try_module_get(dev->driver->owner)) { dev_info(dev, "module unloading, skipping suspend\n"); return 0; } + module_put(dev->driver->owner); + return catpt_suspend(dev); } -- cgit