Skip to contentSkip to conversation

Make master_xfer debug messages more useful

PATCH New Jean Delvare 2 participants 2 messages May 19, 2005 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make master_xfer debug messages more useful

Hi Greg,

While working on the recent saa7110 mess, I found that the debug message displayed when calling master_xfer wasn't as useful as it could be. Here is a patch improving this.

Please apply,
thanks.

drivers/i2c/i2c-core.c renamed from drivers/i2c/i2c-core.c.orig +7 -1
@@ -588,7 +588,13 @@
 	int ret;
 
 	if (adap->algo->master_xfer) {
- 	 	dev_dbg(&adap->dev, "master_xfer: with %d msgs.\n", num);
+#ifdef DEBUG
+		for (ret = 0; ret < num; ret++) {
+			dev_dbg(&adap->dev, "master_xfer[%d] %c, addr=0x%02x, "
+				"len=%d\n", ret, msgs[ret].flags & I2C_M_RD ?
+				'R' : 'W', msgs[ret].addr, msgs[ret].len);
+		}
+#endif
 
 		down(&adap->bus_lock);
 		ret = adap->algo->master_xfer(adap,msgs,num);
Signature · 1 line
Jean Delvare
Applied
#1 lore raw

PATCH 1/1 Make master_xfer debug messages more useful

Quoted 5 lines · Jean Delvare

Hi Greg,

While working on the recent saa7110 mess, I found that the debug message displayed when calling master_xfer wasn't as useful as it could be. Here is a patch improving this.

Applied, thanks.

greg k-h