From: Hans de Goede <hdego...@redhat.com>

media: ov08x40: Don't log ov08x40_check_hwcfg() errors twice

upstream status: Accepted in media subsystem co-maintainer tree:
https://git.linuxtv.org/sailus/media_tree.git/log/drivers/media/i2c/ov08x40.c?h=devel
(this tree gets rebased before merging so no git hash)

All ov08x40_check_hwcfg() error-exit paths already log a detailed reason,
logging a second generic "failed to check hwcfg" error is not useful, and
in case of the fwnode check failing with -EPROBE_DEFER this is outright
problematic flooding the log with:

[    4.557059] ov08x40 i2c-OVTI08F4:00: failed to check hwcfg: -517
[    4.559636] ov08x40 i2c-OVTI08F4:00: failed to check hwcfg: -517
etc.

messages.

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

Make ov08x40_check_hwcfg() log an error in that case too and drop
the duplicate "failed to check hwcfg: %d\n" error logging.

Signed-off-by: Hans de Goede <hdego...@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ai...@linux.intel.com>

diff --git a/drivers/media/i2c/ov08x40.c b/drivers/media/i2c/ov08x40.c
index blahblah..blahblah 100644
--- a/drivers/media/i2c/ov08x40.c
+++ b/drivers/media/i2c/ov08x40.c
@@ -2164,7 +2164,7 @@ static int ov08x40_check_hwcfg(struct ov08x40 *ov08x, 
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");
 
        ov08x->reset_gpio = devm_gpiod_get_optional(dev, "reset",
                                                    GPIOD_OUT_LOW);
@@ -2251,10 +2251,8 @@ static int ov08x40_probe(struct i2c_client *client)
 
        /* Check HW config */
        ret = ov08x40_check_hwcfg(ov08x, &client->dev);
-       if (ret) {
-               dev_err(&client->dev, "failed to check hwcfg: %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        /* Initialize subdev */
        v4l2_i2c_subdev_init(&ov08x->sd, client, &ov08x40_subdev_ops);

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3671

-- 
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to