summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorCan Peng <pengcan@kylinos.cn>2026-07-20 10:43:12 +0800
committerJonathan Cameron <jonathan.cameron@oss.qualcomm.com>2026-07-24 00:53:47 +0100
commit0b5e142ced4bcf20532da051934bd694d1bbd470 (patch)
treefc028ae8d4ab91a07eb55dcd0c1acdc784737d8d /include/linux
parentfa2000702618660ec9ab111d9b0f0a99c6ff50ab (diff)
iio: pressure: mpl115: Fix runtime PM cleanup
mpl115_probe() enables runtime PM when a shutdown GPIO is present and then returns the result of devm_iio_device_register(). If registration fails, runtime PM remains enabled and autosuspend remains selected. The same unmanaged runtime PM state is also left behind on driver unbind, as the IIO device registration is managed but the runtime PM setup is not. Use devm_pm_runtime_enable() so runtime PM is disabled automatically on probe failure and driver unbind, and check pm_runtime_set_active() so setup errors are reported. Set the autosuspend parameters before enabling runtime PM. Once probe has completed, the driver core queues an idle request for the device, so an explicit pm_runtime_get_noresume()/pm_runtime_put() pair is not needed to start autosuspend. Fixes: 0c3a333524a3 ("iio: pressure: mpl115: Implementing low power mode by shutdown gpio") Cc: stable@vger.kernel.org Suggested-by: jonathan.cameron@oss.qualcomm.com Signed-off-by: Can Peng <pengcan@kylinos.cn> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions