From: Hans de Goede Date: Thu, 19 Dec 2024 19:27:33 +0000 (+0100) Subject: media: hi556: Don't log hi556_check_hwcfg() errors twice X-Git-Tag: v6.15-rc1~174^2~205 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8525bd0a714e425b54d19f82bcfc95ea3b8b742;p=thirdparty%2Fkernel%2Flinux.git media: hi556: Don't log hi556_check_hwcfg() errors twice 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 Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil --- diff --git a/drivers/media/i2c/hi556.c b/drivers/media/i2c/hi556.c index 57c51d0e9c4e8..9b5b657f75f94 100644 --- a/drivers/media/i2c/hi556.c +++ b/drivers/media/i2c/hi556.c @@ -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)