iio: pressure: dps310: consistently check return value of `regmap_read`
authorThomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
Mon, 15 Apr 2024 10:50:29 +0000 (12:50 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 20 Apr 2024 13:53:02 +0000 (14:53 +0100)
Align the check of return values `regmap_read` so that it's consistent
across this driver code.

Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
Link: https://lore.kernel.org/r/20240415105030.1161770-4-thomas.haemmerle@leica-geosystems.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/dps310.c

index 3fc436f36fa7673be65141ffc365512562bd6657..c30623d96f0e483a87f53befff9638420c660103 100644 (file)
@@ -171,7 +171,7 @@ static int dps310_temp_workaround(struct dps310_data *data)
        int reg;
 
        rc = regmap_read(data->regmap, 0x32, &reg);
-       if (rc)
+       if (rc < 0)
                return rc;
 
        /*