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;
+ if (enable)
+ pm_runtime_put_autosuspend(dev);
+ return ret;
}
/*
if (en && dac->common->hfsel)
udelay(1);
- if (!enable) {
- pm_runtime_mark_last_busy(dev);
+ if (!enable)
pm_runtime_put_autosuspend(dev);
- }
return 0;
-
-err_put_pm:
- if (enable) {
- pm_runtime_mark_last_busy(dev);
- pm_runtime_put_autosuspend(dev);
- }
-
- return ret;
}
static int stm32_dac_get_value(struct stm32_dac *dac, int channel, int *val)
if (ret)
goto err_pm_put;
- pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
return 0;