]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: hi556: Don't log hi556_check_hwcfg() errors twice
authorHans de Goede <hdegoede@redhat.com>
Thu, 19 Dec 2024 19:27:33 +0000 (20:27 +0100)
committerHans Verkuil <hverkuil@xs4all.nl>
Sat, 15 Feb 2025 14:22:37 +0000 (15:22 +0100)
All hi556_check_hwcfg() error-exit paths already log a detailed reason,
logging a second generic "failed to check HW configuration" error is not
useful, and in case of the fwnode check failing with -EPROBE_DEFER this
is outright problematic flooding the log with:

[    6.336318] hi556 i2c-INT3537:00: failed to check HW configuration: -517
[    6.339006] hi556 i2c-INT3537:00: failed to check HW configuration: -517
[    6.346293] hi556 i2c-INT3537:00: failed to check HW configuration: -517
[    6.356129] hi556 i2c-INT3537:00: failed to check HW configuration: -517
[    6.380316] hi556 i2c-INT3537:00: failed to check HW configuration: -517
etc.

The one exception to all hi556_check_hwcfg() error-exit paths already
logging an error is on v4l2_fwnode_endpoint_alloc_parse() errors.

Make hi556_check_hwcfg() log an error in that case too and drop
the duplicate "failed to check HW configuration" error logging.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2307279
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/hi556.c

index 57c51d0e9c4e8049a977f3a1a7ccc803b829bc29..9b5b657f75f94eeaf249a8d82b466936c8d4e6de 100644 (file)
@@ -1226,7 +1226,7 @@ static int hi556_check_hwcfg(struct device *dev)
        ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg);
        fwnode_handle_put(ep);
        if (ret)
-               return ret;
+               return dev_err_probe(dev, ret, "parsing endpoint failed\n");
 
        ret = fwnode_property_read_u32(fwnode, "clock-frequency", &mclk);
        if (ret) {
@@ -1334,11 +1334,8 @@ static int hi556_probe(struct i2c_client *client)
        int ret;
 
        ret = hi556_check_hwcfg(&client->dev);
-       if (ret) {
-               dev_err(&client->dev, "failed to check HW configuration: %d\n",
-                       ret);
+       if (ret)
                return ret;
-       }
 
        hi556 = devm_kzalloc(&client->dev, sizeof(*hi556), GFP_KERNEL);
        if (!hi556)