[PATCH v2 14/19] iio: chemical: bme680: Make error checks consistent

From: Vasileios Amoiridis
Date: Thu Jun 06 2024 - 17:28:26 EST


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@xxxxxxxxx>
---
drivers/iio/chemical/bme680_core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c
index 3c33c21b5d6a..25d128e1ddcf 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)
--
2.25.1