summaryrefslogtreecommitdiff
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-20 11:36:42 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-18 10:11:09 -0200
commite513411489202fc642c0d651479b9ccdff961ed0 (patch)
tree497be566ea7d0163da9b20b2da13f0c5c590c7d8 /drivers/media/i2c
parentad0e374470684692d7ec1f31ac23065dab4d9d53 (diff)
[media] tvp5150: get rid of KERN_CONT
Unfortunately, KERN_CONT doesn't work with dev_foo(), producing weird messages like: tvp5150 6-005c: tvp5150: read 0xf6 = 0xff ff So, we need to get rid of it. As we're always printing read/write in hexa when dumping multiple register values, also remove the "0x" from the read/write debug messages too. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/tvp5150.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index d0dbdd7ea233..6737685d5be5 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -102,20 +102,22 @@ static int tvp5150_write(struct v4l2_subdev *sd, unsigned char addr,
static void dump_reg_range(struct v4l2_subdev *sd, char *s, u8 init,
const u8 end, int max_line)
{
- int i = 0;
+ u8 buf[16];
+ int i = 0, j, len;
- while (init != (u8)(end + 1)) {
- if ((i % max_line) == 0) {
- if (i > 0)
- printk("\n");
- printk("tvp5150: %s reg 0x%02x = ", s, init);
- }
- printk("%02x ", tvp5150_read(sd, init));
+ if (max_line > 16) {
+ dprintk0(sd->dev, "too much data to dump\n");
+ return;
+ }
+
+ for (i = init; i < end; i += max_line) {
+ len = (end - i > max_line) ? max_line : end - i;
+
+ for (j = 0; j < len; j++)
+ buf[j] = tvp5150_read(sd, i + j);
- init++;
- i++;
+ dprintk0(sd->dev, "%s reg %02x = %*ph\n", s, i, len, buf);
}
- printk("\n");
}
static int tvp5150_log_status(struct v4l2_subdev *sd)