* [PATCH] [media] af9035: issue an error message when i2c stuff fails
@ 2019-07-07 20:59 Uwe Kleine-König
2019-12-31 9:37 ` Sean Young
0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2019-07-07 20:59 UTC (permalink / raw)
To: Antti Palosaari, Mauro Carvalho Chehab; +Cc: linux-media
Instead of failing silent give a hint what went wrong.
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
drivers/media/usb/dvb-usb-v2/af9035.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index de52309eaaab..f5701fab192c 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -211,13 +211,19 @@ static int af9035_add_i2c_dev(struct dvb_usb_device *d, const char *type,
/* register I2C device */
client = i2c_new_device(adapter, &board_info);
- if (client == NULL || client->dev.driver == NULL) {
+ if (client == NULL) {
+ dev_err(&intf->dev, "failed to register i2c device\n");
+ ret = -ENODEV;
+ goto err;
+ } else if (client->dev.driver == NULL) {
+ dev_err(&intf->dev, "no driver for i2c device (type=%s)\n", type);
ret = -ENODEV;
goto err;
}
/* increase I2C driver usage count */
if (!try_module_get(client->dev.driver->owner)) {
+ dev_err(&intf->dev, "failed to get module for i2c driver\n");
i2c_unregister_device(client);
ret = -ENODEV;
goto err;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] [media] af9035: issue an error message when i2c stuff fails
2019-07-07 20:59 [PATCH] [media] af9035: issue an error message when i2c stuff fails Uwe Kleine-König
@ 2019-12-31 9:37 ` Sean Young
0 siblings, 0 replies; 2+ messages in thread
From: Sean Young @ 2019-12-31 9:37 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Antti Palosaari, Mauro Carvalho Chehab, linux-media
Hello Uwe,
First apologies for taking so long to get to your patch.
On Sun, Jul 07, 2019 at 10:59:33PM +0200, Uwe Kleine-König wrote:
> Instead of failing silent give a hint what went wrong.
>
> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
> ---
> drivers/media/usb/dvb-usb-v2/af9035.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
> index de52309eaaab..f5701fab192c 100644
> --- a/drivers/media/usb/dvb-usb-v2/af9035.c
> +++ b/drivers/media/usb/dvb-usb-v2/af9035.c
> @@ -211,13 +211,19 @@ static int af9035_add_i2c_dev(struct dvb_usb_device *d, const char *type,
>
> /* register I2C device */
> client = i2c_new_device(adapter, &board_info);
> - if (client == NULL || client->dev.driver == NULL) {
> + if (client == NULL) {
> + dev_err(&intf->dev, "failed to register i2c device\n");
> + ret = -ENODEV;
> + goto err;
> + } else if (client->dev.driver == NULL) {
> + dev_err(&intf->dev, "no driver for i2c device (type=%s)\n", type);
> ret = -ENODEV;
> goto err;
> }
i2c_new_device() calls i2c_new_client_device(), which in every error path
does a dev_err(). I suspect that this patch has become obsolete because
of fixes in i2c.
Thanks,
Sean
>
> /* increase I2C driver usage count */
> if (!try_module_get(client->dev.driver->owner)) {
> + dev_err(&intf->dev, "failed to get module for i2c driver\n");
> i2c_unregister_device(client);
> ret = -ENODEV;
> goto err;
> --
> 2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-31 9:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-07 20:59 [PATCH] [media] af9035: issue an error message when i2c stuff fails Uwe Kleine-König
2019-12-31 9:37 ` Sean Young
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).