Message ID | 20250124-ub9xx-improvements-v2-3-f7075c99ea20@ideasonboard.com |
---|---|
State | New |
Headers | show |
Series | [v2,01/22] media: i2c: ds90ub953: Fix error prints | expand |
diff --git a/drivers/media/i2c/ds90ub913.c b/drivers/media/i2c/ds90ub913.c index 5d754372230e..4a0c1e7cb8bb 100644 --- a/drivers/media/i2c/ds90ub913.c +++ b/drivers/media/i2c/ds90ub913.c @@ -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)
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> --- drivers/media/i2c/ds90ub913.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)