media: ov08x40: Error logging improvements
cover media: ov08x40: Error logging improvements
Hi All,
Here are 2 small ov08x40 driver error logging improvements.
Note these 2 patches apply on top of my series from earlier today:
https://lore.kernel.org/linux-media/[email protected]/
Regards,
Hans
Hans de Goede (2):
media: ov08x40: Add missing '\n' to ov08x40_check_hwcfg() error
messages
media: ov08x40: Don't log ov08x40_check_hwcfg() errors twice
drivers/media/i2c/ov08x40.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
Signature · 1 line
2.47.1
PATCH 1/2 media: ov08x40: Add missing '\n' to ov08x40_check_hwcfg() error messages
A number of dev_err() error messages miss a terminating '\n', add the missing '\n' to these.
--- drivers/media/i2c/ov08x40.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/media/i2c/ov08x40.c +6 -6
@@ -2194,27 +2194,27 @@ static int ov08x40_check_hwcfg(struct ov08x40 *ov08x, struct device *dev) ret =fwnode_property_read_u32 (dev_fwnode (dev),"clock-frequency" , &xvclk_rate);if (ret) { -dev_err (dev,"can't get clock frequency" ); +dev_err (dev,"can't get clock frequency\n" ); goto out_err; } }if (xvclk_rate !=OV08X40_XVCLK ) { -dev_err (dev,"external clock %d is not supported" , +dev_err (dev,"external clock %d is not supported\n" , xvclk_rate); ret = -EINVAL ; goto out_err; }if (bus_cfg.bus.mipi_csi2.num_data_lanes !=OV08X40_DATA_LANES ) { -dev_err (dev,"number of CSI2 data lanes %d is not supported" , +dev_err (dev,"number of CSI2 data lanes %d is not supported\n" , bus_cfg.bus.mipi_csi2.num_data_lanes); ret = -EINVAL ; goto out_err; }if (!bus_cfg.nr_of_link_frequencies) { -dev_err (dev,"no link frequencies defined" ); +dev_err (dev,"no link frequencies defined\n" ); ret = -EINVAL ; goto out_err; }
@@ -2227,7 +2227,7 @@ static int ov08x40_check_hwcfg(struct ov08x40 *ov08x, struct device *dev) }if (j == bus_cfg.nr_of_link_frequencies) { -dev_err (dev,"no link frequency %lld supported" , +dev_err (dev,"no link frequency %lld supported\n" , link_freq_menu_items[i]); ret = -EINVAL ; goto out_err;
@@ -2252,7 +2252,7 @@ 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" , ret); +dev_err (&client->dev,"failed to check hwcfg: %d\n" , ret);return ret; }
Signature · 1 line
2.47.1
PATCH 2/2 media: ov08x40: Don't log ov08x40_check_hwcfg() errors twice
In reply to Hans de GoedeAll 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.
--- drivers/media/i2c/ov08x40.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/media/i2c/ov08x40.c +2 -4
@@ -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);
Signature · 1 line
2.47.1