aboutsummaryrefslogtreecommitdiff
path: root/drivers/iio/accel/st_accel_core.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2022-02-07 15:38:31 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-04-10 16:15:02 +0100
commit69c9887997729cc989849e6cba17fb11093ade1d (patch)
tree924ceaae8e98cffe00a7c8e635e857c44f243b2d /drivers/iio/accel/st_accel_core.c
parentf8ac59f5379f05b2f43b891672a222da72e036f2 (diff)
iio: st_sensors: Return as early as possible from the _write_raw() callbacks
As there is no cleanup to do, let's return as early as possible in the various ST sensor drivers _write_raw() callback functions. There is no functional change. Suggested-by: Jonathan Cameron <jic23@kernel.org> Cc: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220207143840.707510-5-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel/st_accel_core.c')
-rw-r--r--drivers/iio/accel/st_accel_core.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
index 673f3807f001..e029589a668a 100644
--- a/drivers/iio/accel/st_accel_core.c
+++ b/drivers/iio/accel/st_accel_core.c
@@ -1217,8 +1217,7 @@ static int st_accel_write_raw(struct iio_dev *indio_dev,
int gain;
gain = val * 1000000 + val2;
- err = st_sensors_set_fullscale_by_gain(indio_dev, gain);
- break;
+ return st_sensors_set_fullscale_by_gain(indio_dev, gain);
}
case IIO_CHAN_INFO_SAMP_FREQ:
if (val2)
@@ -1230,8 +1229,6 @@ static int st_accel_write_raw(struct iio_dev *indio_dev,
default:
return -EINVAL;
}
-
- return err;
}
static ST_SENSORS_DEV_ATTR_SAMP_FREQ_AVAIL();