[PATCH v1 22/23] ASoC: rockchip: Discard pm_runtime_put() return value
Rafael J. Wysocki
rafael at kernel.org
Mon Dec 22 12:35:33 PST 2025
From: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
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 at intel.com>
---
This patch is part of a series, but it doesn't depend on anything else
in that series. The last patch in the series depends on it.
It can be applied by itself and if you decide to do so, please let me
know.
Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.
---
sound/soc/rockchip/rockchip_sai.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/sound/soc/rockchip/rockchip_sai.c
+++ b/sound/soc/rockchip/rockchip_sai.c
@@ -1487,8 +1487,9 @@ static int rockchip_sai_probe(struct pla
return 0;
err_runtime_suspend:
- /* If we're !CONFIG_PM, we get -ENOSYS and disable manually */
- if (pm_runtime_put(&pdev->dev))
+ if (IS_ENABLED(CONFIG_PM))
+ pm_runtime_put(&pdev->dev);
+ else
rockchip_sai_runtime_suspend(&pdev->dev);
return ret;
More information about the Linux-rockchip
mailing list