All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] media: adv7180: Only print 'chip found' message on successful probe
@ 2019-10-11 10:49 Fabio Estevam
  0 siblings, 0 replies; only message in thread
From: Fabio Estevam @ 2019-10-11 10:49 UTC (permalink / raw)
  To: hverkuil-cisco
  Cc: mchehab, lars, slongerbeam, tharvey, linux-media, Fabio Estevam

Currently the "chip found" message is shown even in the case where the
I2C address is wrongly passed in the device tree, or also in the case of
probe failure, which is misleading.

To avoid such problem, move this message after real I2C transactions
have been successfully made and we are certain that the adv7180 is
really present and probed.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v2:
- Only print the "chip found" message on successful probe

 drivers/media/i2c/adv7180.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index e780969cc2f2..6528e2343fc8 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -1309,9 +1309,6 @@ static int adv7180_probe(struct i2c_client *client,
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
 		return -EIO;
 
-	v4l_info(client, "chip found @ 0x%02x (%s)\n",
-		 client->addr, client->adapter->name);
-
 	state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
 	if (state == NULL)
 		return -ENOMEM;
@@ -1382,6 +1379,9 @@ static int adv7180_probe(struct i2c_client *client,
 	if (ret)
 		goto err_free_irq;
 
+	v4l_info(client, "chip found @ 0x%02x (%s)\n",
+		 client->addr, client->adapter->name);
+
 	return 0;
 
 err_free_irq:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-10-11 10:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-11 10:49 [PATCH v3] media: adv7180: Only print 'chip found' message on successful probe Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.