mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
ASoC: SDCA: Add better pm_runtime error handling in func probe
Add a common error path in probe that balances the runtime PM reference.
Fixes: 3af1815a2f ("ASoC: SDCA: Add basic SDCA function driver")
Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260924095458.2683755-3-mstrozek@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
b16610e377
commit
91094f9c86
|
|
@ -388,20 +388,27 @@ static int class_function_probe(struct auxiliary_device *auxdev,
|
|||
|
||||
ret = devm_pm_runtime_enable(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_pm;
|
||||
|
||||
ret = class_function_boot(drv);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_pm;
|
||||
|
||||
ret = devm_snd_soc_register_component(dev, cmp_drv, dais, num_dais);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "failed to register component\n");
|
||||
if (ret) {
|
||||
dev_err_probe(dev, ret, "failed to register component\n");
|
||||
goto err_pm;
|
||||
}
|
||||
|
||||
pm_runtime_mark_last_busy(dev);
|
||||
pm_runtime_put_autosuspend(dev);
|
||||
|
||||
return 0;
|
||||
|
||||
err_pm:
|
||||
pm_runtime_put_sync(dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void class_function_remove(struct auxiliary_device *auxdev)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user