[PATCH] I2C: Make master_xfer debug messages more useful

2005-03-31 Thread Greg KH
ChangeSet 1.2328, 2005/03/31 14:07:05-08:00, [EMAIL PROTECTED]

[PATCH] I2C: Make master_xfer debug messages more useful

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.

Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 drivers/i2c/i2c-core.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletion(-)


diff -Nru a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
--- a/drivers/i2c/i2c-core.c2005-03-31 15:18:36 -08:00
+++ b/drivers/i2c/i2c-core.c2005-03-31 15:18:36 -08:00
@@ -587,7 +587,13 @@
int ret;
 
if (adap->algo->master_xfer) {
-   dev_dbg(>dev, "master_xfer: with %d msgs.\n", num);
+#ifdef DEBUG
+   for (ret = 0; ret < num; ret++) {
+   dev_dbg(>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(>bus_lock);
ret = adap->algo->master_xfer(adap,msgs,num);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] I2C: Make master_xfer debug messages more useful

2005-03-31 Thread Greg KH
ChangeSet 1.2328, 2005/03/31 14:07:05-08:00, [EMAIL PROTECTED]

[PATCH] I2C: Make master_xfer debug messages more useful

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.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]


 drivers/i2c/i2c-core.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletion(-)


diff -Nru a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
--- a/drivers/i2c/i2c-core.c2005-03-31 15:18:36 -08:00
+++ b/drivers/i2c/i2c-core.c2005-03-31 15:18:36 -08:00
@@ -587,7 +587,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);

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/