Skip to content

Commit f38d43d

Browse files
crojewsk-intelbroonie
authored andcommitted
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: 7a10b66 ("ASoC: Intel: catpt: Device driver lifecycle") Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Acked-by: Randy Dunlap <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 6db282c commit f38d43d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sound/soc/intel/catpt/device.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@ static int __maybe_unused catpt_resume(struct device *dev)
8181
if (ret)
8282
return ret;
8383

84-
if (!module_is_live(dev->driver->owner)) {
84+
if (!try_module_get(dev->driver->owner)) {
8585
dev_info(dev, "module unloading, skipping fw boot\n");
8686
return 0;
8787
}
88+
module_put(dev->driver->owner);
8889

8990
ret = catpt_boot_firmware(cdev, true);
9091
if (ret) {
@@ -107,10 +108,12 @@ static int __maybe_unused catpt_resume(struct device *dev)
107108

108109
static int __maybe_unused catpt_runtime_suspend(struct device *dev)
109110
{
110-
if (!module_is_live(dev->driver->owner)) {
111+
if (!try_module_get(dev->driver->owner)) {
111112
dev_info(dev, "module unloading, skipping suspend\n");
112113
return 0;
113114
}
115+
module_put(dev->driver->owner);
116+
114117
return catpt_suspend(dev);
115118
}
116119

0 commit comments

Comments
 (0)