[media] saa7134-i2c: simplify debug dump and use pr_info()
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 30 Apr 2015 12:15:08 +0000 (09:15 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 13 May 2015 13:10:36 +0000 (10:10 -0300)
Instead of implement its own hexdump logic, use the printk
format, and convert to use pr_info().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/pci/saa7134/saa7134-i2c.c

index b140143dba7dde8ad54149550d270d5ae1ef9ac9..ef3c33e3757dd6253352c7c6d2144e16950f717e 100644 (file)
@@ -369,13 +369,12 @@ saa7134_i2c_eeprom(struct saa7134_dev *dev, unsigned char *eedata, int len)
                       dev->name,err);
                return -1;
        }
-       for (i = 0; i < len; i++) {
-               if (0 == (i % 16))
-                       pr_info("%s: i2c eeprom %02x:",dev->name,i);
-               printk(" %02x",eedata[i]);
-               if (15 == (i % 16))
-                       printk("\n");
+
+       for (i = 0; i < len; i+= 16) {
+               int size = (len - i) > 16 ? 16 : len - i;
+               pr_info("i2c eeprom %02x: %*ph\n", i, size, &eedata[i]);
        }
+
        return 0;
 }