[PATCH 2/3] i2c: write debug print when registering any i2c client

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jan 16 05:36:38 PST 2023


There's no debug message when registering a device over DT, only via
legacy board info. Add a common print instead.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/i2c/i2c.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
index a7b5cb94ff13..3b5e68618dff 100644
--- a/drivers/i2c/i2c.c
+++ b/drivers/i2c/i2c.c
@@ -410,6 +410,9 @@ static struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
 	if (chip->of_node)
 		chip->of_node->dev = &client->dev;
 
+	dev_dbg(&client->dev, "registered on bus %d, chip->addr 0x%02x\n",
+		adapter->nr, client->addr);
+
 	return client;
 }
 
@@ -541,7 +544,6 @@ static void scan_boardinfo(struct i2c_adapter *adapter)
 			continue;
 
 		for (n = bi->n_board_info; n > 0; n--, chip++) {
-			debug("%s: bus_num: %d, chip->addr 0x%02x\n", __func__, bi->bus_num, chip->addr);
 			/*
 			 * NOTE: this relies on i2c_new_device to
 			 * issue diagnostics when given bogus inputs
-- 
2.30.2




More information about the barebox mailing list