]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: ov08x40: Improve ov08x40_identify_module() error logging
authorHans de Goede <hdegoede@redhat.com>
Fri, 20 Dec 2024 14:41:26 +0000 (15:41 +0100)
committerHans Verkuil <hverkuil@xs4all.nl>
Sat, 15 Feb 2025 14:22:39 +0000 (15:22 +0100)
ov08x40_identify_module() already logs an error if the read ID mismatches,
so having its caller also log an error results in 2 errors in this case.

Add error logging to the ID register read in ov08x40_identify_module() and
drop the error logging in the caller.

Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/ov08x40.c

index 8d683af54d35bbc84faf5cdabdf8e01c7530de15..10ec9896ca612f3ec265e706c4e60db756c3bfe2 100644 (file)
@@ -1943,8 +1943,10 @@ static int ov08x40_identify_module(struct ov08x40 *ov08x)
 
        ret = ov08x40_read_reg(ov08x, OV08X40_REG_CHIP_ID,
                               OV08X40_REG_VALUE_24BIT, &val);
-       if (ret)
+       if (ret) {
+               dev_err(&client->dev, "error reading chip-id register: %d\n", ret);
                return ret;
+       }
 
        if (val != OV08X40_CHIP_ID) {
                dev_err(&client->dev, "chip id mismatch: %x!=%x\n",
@@ -2262,10 +2264,8 @@ static int ov08x40_probe(struct i2c_client *client)
 
                /* Check module identity */
                ret = ov08x40_identify_module(ov08x);
-               if (ret) {
-                       dev_err(&client->dev, "failed to find sensor: %d\n", ret);
+               if (ret)
                        goto probe_power_off;
-               }
        }
 
        /* Set default mode to max resolution */