Commit a94abc74 authored by William Breathitt Gray's avatar William Breathitt Gray Committed by Jonathan Cameron

iio: addac: stx104: Improve indentation in stx104_write_raw()

By bailing out early if chan->output is false for the IIO_CHAN_INFO_RAW,
indentation can be decreased by a tab and code readability improved.
Suggested-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarWilliam Breathitt Gray <william.gray@linaro.org>
Link: https://lore.kernel.org/r/487d17da9e2612f3e6b2bd1c3def2fa1b955db9b.1680790580.git.william.gray@linaro.orgSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 46a4cac7
...@@ -181,19 +181,19 @@ static int stx104_write_raw(struct iio_dev *indio_dev, ...@@ -181,19 +181,19 @@ static int stx104_write_raw(struct iio_dev *indio_dev,
return 0; return 0;
case IIO_CHAN_INFO_RAW: case IIO_CHAN_INFO_RAW:
if (chan->output) { if (!chan->output)
if (val < 0 || val > U16_MAX) return -EINVAL;
return -EINVAL;
mutex_lock(&priv->lock); if (val < 0 || val > U16_MAX)
return -EINVAL;
priv->chan_out_states[chan->channel] = val; mutex_lock(&priv->lock);
iowrite16(val, &priv->reg->dac[chan->channel]);
mutex_unlock(&priv->lock); priv->chan_out_states[chan->channel] = val;
return 0; iowrite16(val, &priv->reg->dac[chan->channel]);
}
return -EINVAL; mutex_unlock(&priv->lock);
return 0;
} }
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment