[PATCH v3 10/15] iio: chemical: bme680: Make error checks consistent

From: Vasileios Amoiridis
Date: Sun Jun 09 2024 - 19:40:46 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 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)
--
2.25.1