Commit 86ff6cb1 authored by Puranjay Mohan's avatar Puranjay Mohan Committed by Jonathan Cameron

iio: accel: adxl355: use if(ret) in place of ret < 0

Replace if(ret < 0) with if(ret) for consistency.
Signed-off-by: default avatarPuranjay Mohan <puranjay12@gmail.com>
Link: https://lore.kernel.org/r/20210903184312.21009-2-puranjay12@gmail.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 636d4463
......@@ -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;
}
......
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