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

iio: dac: Remove redundant pm_runtime_mark_last_busy() calls

pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-redundant explicit call to
pm_runtime_mark_last_busy().

Also clean up error handling in stm32_dac_set_enable_state().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20250828140617.3193288-1-sakari.ailus@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Sakari Ailus and committed by
Jonathan Cameron
7c873e3f dfbbee09

+5 -14
+5 -14
drivers/iio/dac/stm32-dac.c
··· 82 82 83 83 ret = regmap_update_bits(dac->common->regmap, STM32_DAC_CR, msk, en); 84 84 mutex_unlock(&dac->lock); 85 - if (ret < 0) { 85 + if (ret) { 86 86 dev_err(&indio_dev->dev, "%s failed\n", str_enable_disable(en)); 87 - goto err_put_pm; 87 + if (enable) 88 + pm_runtime_put_autosuspend(dev); 89 + return ret; 88 90 } 89 91 90 92 /* ··· 97 95 if (en && dac->common->hfsel) 98 96 udelay(1); 99 97 100 - if (!enable) { 101 - pm_runtime_mark_last_busy(dev); 98 + if (!enable) 102 99 pm_runtime_put_autosuspend(dev); 103 - } 104 100 105 101 return 0; 106 - 107 - err_put_pm: 108 - if (enable) { 109 - pm_runtime_mark_last_busy(dev); 110 - pm_runtime_put_autosuspend(dev); 111 - } 112 - 113 - return ret; 114 102 } 115 103 116 104 static int stm32_dac_get_value(struct stm32_dac *dac, int channel, int *val) ··· 341 349 if (ret) 342 350 goto err_pm_put; 343 351 344 - pm_runtime_mark_last_busy(dev); 345 352 pm_runtime_put_autosuspend(dev); 346 353 347 354 return 0;