Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: rockchip: Discard pm_runtime_put() return value

It is better to check directly whether or not CONFIG_PM has
been enabled instead of relying on an error value returned by
pm_runtime_put() in that case because pm_runtime_put() may also return
an error value in other cases, like after writing "on" to the devices'
runtime PM "control" attribute in sysfs for one example.

This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/5160923.0VBMTVartN@rafael.j.wysocki
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Rafael J. Wysocki and committed by
Mark Brown
f92d27a6 9b7688c1

+3 -2
+3 -2
sound/soc/rockchip/rockchip_sai.c
··· 1487 1487 return 0; 1488 1488 1489 1489 err_runtime_suspend: 1490 - /* If we're !CONFIG_PM, we get -ENOSYS and disable manually */ 1491 - if (pm_runtime_put(&pdev->dev)) 1490 + if (IS_ENABLED(CONFIG_PM)) 1491 + pm_runtime_put(&pdev->dev); 1492 + else 1492 1493 rockchip_sai_runtime_suspend(&pdev->dev); 1493 1494 1494 1495 return ret;