linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <uwe@kleine-koenig.org>
To: Antti Palosaari <crope@iki.fi>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org
Subject: [PATCH] [media] af9035: issue an error message when i2c stuff fails
Date: Sun,  7 Jul 2019 22:59:33 +0200	[thread overview]
Message-ID: <20190707205933.23059-1-uwe@kleine-koenig.org> (raw)

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


             reply	other threads:[~2019-07-07 21:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-07 20:59 Uwe Kleine-König [this message]
2019-12-31  9:37 ` [PATCH] [media] af9035: issue an error message when i2c stuff fails Sean Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190707205933.23059-1-uwe@kleine-koenig.org \
    --to=uwe@kleine-koenig.org \
    --cc=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).