summaryrefslogtreecommitdiff
path: root/drivers/iio/chemical/bme680_core.c
diff options
context:
space:
mode:
authorVasileios Amoiridis <vassilisamir@gmail.com>2024-06-10 01:38:21 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-08-03 10:13:35 +0100
commit8bc1f428ba1f1312107b24a367a7c80881bd3cc0 (patch)
tree0f461ce73a86de4532d69cc3af3e40ed200c8322 /drivers/iio/chemical/bme680_core.c
parentf2f2e7b1a4522d9dc0883e1baf0dea61544cc12b (diff)
iio: chemical: bme680: Make error checks consistent
In the majority of the error checks after a regmap_{read,write}() operation the following coding style is used: ret = regmap_{read,write}(data->regmap, ...); if (ret < 0) { dev_err(dev, ...); return ret; } In this particular case it was different so change it for consistency. Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com> Link: https://patch.msgid.link/20240609233826.330516-11-vassilisamir@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/chemical/bme680_core.c')
-rw-r--r--drivers/iio/chemical/bme680_core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c
index 415816a6cc9b..a54460fddc91 100644
--- a/drivers/iio/chemical/bme680_core.c
+++ b/drivers/iio/chemical/bme680_core.c
@@ -517,10 +517,12 @@ static int bme680_chip_config(struct bme680_data *data)
ret = regmap_write_bits(data->regmap, BME680_REG_CTRL_MEAS,
BME680_OSRS_TEMP_MASK | BME680_OSRS_PRESS_MASK,
osrs);
- if (ret < 0)
+ if (ret < 0) {
dev_err(dev, "failed to write ctrl_meas register\n");
+ return ret;
+ }
- return ret;
+ return 0;
}
static int bme680_gas_config(struct bme680_data *data)