On Mon, 25 Aug 2025 16:53:54 +0300 Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> wrote: > 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-reduntant 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@xxxxxxxxxxxxxxx> Hi Sakari, I don't follow this... > --- > drivers/iio/dac/stm32-dac.c | 19 ++++--------------- > 1 file changed, 4 insertions(+), 15 deletions(-) > > diff --git a/drivers/iio/dac/stm32-dac.c b/drivers/iio/dac/stm32-dac.c > index 344388338d9b..e8688f9d6df7 100644 > --- a/drivers/iio/dac/stm32-dac.c > +++ b/drivers/iio/dac/stm32-dac.c > @@ -82,9 +82,9 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch, > > ret = regmap_update_bits(dac->common->regmap, STM32_DAC_CR, msk, en); > mutex_unlock(&dac->lock); > - if (ret < 0) { > + if (ret) { > dev_err(&indio_dev->dev, "%s failed\n", str_enable_disable(en)); > - goto err_put_pm; > + goto err_pm_put; > } > > /* > @@ -95,18 +95,8 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch, > if (en && dac->common->hfsel) > udelay(1); > > - if (!enable) { > - pm_runtime_mark_last_busy(dev); > - pm_runtime_put_autosuspend(dev); > - } > - > - return 0; > - > -err_put_pm: > - if (enable) { > - pm_runtime_mark_last_busy(dev); > - pm_runtime_put_autosuspend(dev); > - } > +err_pm_put: > + pm_runtime_put_autosuspend(dev); now the put is here, whether or not there was ever a get as the get is gated on enable() > > return ret; > } > @@ -349,7 +339,6 @@ static int stm32_dac_probe(struct platform_device *pdev) > if (ret) > goto err_pm_put; > > - pm_runtime_mark_last_busy(dev); > pm_runtime_put_autosuspend(dev); > > return 0;