summaryrefslogtreecommitdiff
path: root/drivers/iio/accel
diff options
context:
space:
mode:
authorPuranjay Mohan <puranjay12@gmail.com>2021-09-03 21:43:11 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-09-14 14:00:35 +0300
commit86ff6cb15f46310a8f88f36f4c5e3b6a9ca32efd (patch)
tree797ea0ff86c6c541a5892fb5b19732a77caac79d /drivers/iio/accel
parent636d44633039348c955947cee561f372846b478b (diff)
downloadlinux-86ff6cb15f46310a8f88f36f4c5e3b6a9ca32efd.tar.xz
iio: accel: adxl355: use if(ret) in place of ret < 0
Replace if(ret < 0) with if(ret) for consistency. Signed-off-by: Puranjay Mohan <puranjay12@gmail.com> Link: https://lore.kernel.org/r/20210903184312.21009-2-puranjay12@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r--drivers/iio/accel/adxl355_core.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c
index f71f64b32a01..d3ed7eec9485 100644
--- a/drivers/iio/accel/adxl355_core.c
+++ b/drivers/iio/accel/adxl355_core.c
@@ -262,7 +262,7 @@ static int adxl355_read_axis(struct adxl355_data *data, u8 addr)
ret = regmap_bulk_read(data->regmap, addr, data->transf_buf,
ARRAY_SIZE(data->transf_buf));
- if (ret < 0)
+ if (ret)
return ret;
return get_unaligned_be24(data->transf_buf);
@@ -294,13 +294,13 @@ static int adxl355_set_odr(struct adxl355_data *data,
}
ret = adxl355_set_op_mode(data, ADXL355_STANDBY);
- if (ret < 0)
+ if (ret)
goto err_unlock;
ret = regmap_update_bits(data->regmap, ADXL355_FILTER_REG,
ADXL355_FILTER_ODR_MSK,
FIELD_PREP(ADXL355_FILTER_ODR_MSK, odr));
- if (ret < 0)
+ if (ret)
goto err_set_opmode;
data->odr = odr;
@@ -333,7 +333,7 @@ static int adxl355_set_hpf_3db(struct adxl355_data *data,
}
ret = adxl355_set_op_mode(data, ADXL355_STANDBY);
- if (ret < 0)
+ if (ret)
goto err_unlock;
ret = regmap_update_bits(data->regmap, ADXL355_FILTER_REG,
@@ -366,7 +366,7 @@ static int adxl355_set_calibbias(struct adxl355_data *data,
mutex_lock(&data->lock);
ret = adxl355_set_op_mode(data, ADXL355_STANDBY);
- if (ret < 0)
+ if (ret)
goto err_unlock;
put_unaligned_be16(calibbias, data->transf_buf);
@@ -598,7 +598,7 @@ int adxl355_core_probe(struct device *dev, struct regmap *regmap,
indio_dev->num_channels = ARRAY_SIZE(adxl355_channels);
ret = adxl355_setup(data);
- if (ret < 0) {
+ if (ret) {
dev_err(dev, "ADXL355 setup failed\n");
return ret;
}