]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: i2c: ds90ub913: Align ub913_read() with other similar functions
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 3 Mar 2025 16:02:06 +0000 (21:32 +0530)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 25 Apr 2025 08:15:03 +0000 (10:15 +0200)
Adjust the ub913_read() to have similar form than the other similar
functions in ub9xx drivers. This makes it easier to deal with all the
read/write functions with a semantic patch.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/ds90ub913.c

index 1445ebbcc9cabb3ab43a670aa165deea52db5f35..facbee79164eec1fbccaea2c1d4d62cf439e49b6 100644 (file)
@@ -125,14 +125,16 @@ static int ub913_read(const struct ub913_data *priv, u8 reg, u8 *val)
        int ret;
 
        ret = regmap_read(priv->regmap, reg, &v);
-       if (ret < 0) {
+       if (ret) {
                dev_err(&priv->client->dev,
                        "Cannot read register 0x%02x: %d!\n", reg, ret);
-               return ret;
+               goto out;
        }
 
        *val = v;
-       return 0;
+
+out:
+       return ret;
 }
 
 static int ub913_write(const struct ub913_data *priv, u8 reg, u8 val)