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>
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;
}