Skip to contentSkip to conversation

media: adv7180: Move 'chip found' message a bit further

PATCH Superseded Fabio Estevam 1 participant 1 message Oct 10, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: adv7180: Move 'chip found' message a bit further

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

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

---
 drivers/media/i2c/adv7180.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/i2c/adv7180.c +3 -3
index e780969cc2f2..15fe65a2863d 100644
@@ -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;
@@ -1370,6 +1367,9 @@ static int adv7180_probe(struct i2c_client *client,
 	if (ret)
 		goto err_media_entity_cleanup;
 
+	v4l_info(client, "chip found @ 0x%02x (%s)\n",
+		 client->addr, client->adapter->name);
+
 	if (state->irq) {
 		ret = request_threaded_irq(client->irq, NULL, adv7180_irq,
 					   IRQF_ONESHOT | IRQF_TRIGGER_FALLING,
Signature · 1 line
2.17.1