summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorStepan Ionichev <sozdayvek@gmail.com>2026-05-29 23:37:08 +0500
committerJonathan Cameron <jic23@kernel.org>2026-07-04 00:07:34 +0100
commit8adc81ba2e674888e95015066ea73f382bd33209 (patch)
treed82b92d960e8d90dc9910152b02cee113e009666 /tools/perf/scripts/python
parentd07bf43d175a2be1371ef5460b3e8f8ba3d60bd7 (diff)
iio: adc: ti-ads1015: use devm helpers to fix probe error paths
Once ads1015_probe() gets past ads1015_set_conv_mode(CONTINUOUS), two resources leak on its error paths and on driver unbind: - pm_runtime_enable() is left enabled if iio_device_register() fails; on subsequent probe/rebind the runtime PM tracking complains about an unbalanced enable. - The CONTINUOUS conversion mode written to the chip is never restored on any error path after that point, so on probe failure the chip is left running. Convert all three teardown operations of ads1015_remove() to devm so that the error paths and the unbind path share the same unwind in reverse-of-setup order: - ads1015_set_conv_mode(SINGLESHOT) becomes a devm action registered immediately after CONTINUOUS mode is enabled. - pm_runtime_enable() becomes devm_pm_runtime_enable(). - iio_device_register() becomes devm_iio_device_register(), so the iio device is unregistered first on unbind. ads1015_remove() is no longer needed and is dropped. Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions