summaryrefslogtreecommitdiff
path: root/drivers/media/pci/cx23885/cx23885-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-11-13 09:46:11 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-18 08:09:36 -0200
commite39682b5d96ae7a33a0f6b5578911913be8f14b6 (patch)
treeb7aa9b903756aca9e874e132e0a604e307ef71b0 /drivers/media/pci/cx23885/cx23885-i2c.c
parentf1dc10b6e18df849429c1625bbcdf04ecc25d5c3 (diff)
[media] cx23885: convert it to use pr_foo() macros
Instead of calling printk() directly, use pr_foo() macros, as suggested at the Kernel's coding style. Please notice that a conversion to dev_foo() is not trivial, as several parts on this driver uses pr_cont(). Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/cx23885/cx23885-i2c.c')
-rw-r--r--drivers/media/pci/cx23885/cx23885-i2c.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-i2c.c b/drivers/media/pci/cx23885/cx23885-i2c.c
index 19faf9a611ed..8528032090f2 100644
--- a/drivers/media/pci/cx23885/cx23885-i2c.c
+++ b/drivers/media/pci/cx23885/cx23885-i2c.c
@@ -15,14 +15,14 @@
* GNU General Public License for more details.
*/
+#include "cx23885.h"
+
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/io.h>
-#include "cx23885.h"
-
#include <media/v4l2-common.h>
static unsigned int i2c_debug;
@@ -35,7 +35,8 @@ MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time");
#define dprintk(level, fmt, arg...)\
do { if (i2c_debug >= level)\
- printk(KERN_DEBUG "%s/0: " fmt, dev->name, ## arg);\
+ printk(KERN_DEBUG pr_fmt("%s: i2c:" fmt), \
+ __func__, ##arg); \
} while (0)
#define I2C_WAIT_DELAY 32
@@ -121,7 +122,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
if (i2c_debug) {
printk(KERN_DEBUG " <W %02x %02x", msg->addr << 1, msg->buf[0]);
if (!(ctrl & I2C_NOSTOP))
- printk(KERN_CONT " >\n");
+ pr_cont(" >\n");
}
for (cnt = 1; cnt < msg->len; cnt++) {
@@ -141,9 +142,9 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
if (!i2c_wait_done(i2c_adap))
goto eio;
if (i2c_debug) {
- printk(KERN_CONT " %02x", msg->buf[cnt]);
+ pr_cont(" %02x", msg->buf[cnt]);
if (!(ctrl & I2C_NOSTOP))
- printk(KERN_CONT " >\n");
+ pr_cont(" >\n");
}
}
return msg->len;
@@ -151,7 +152,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
eio:
retval = -EIO;
if (i2c_debug)
- printk(KERN_ERR " ERR: %d\n", retval);
+ pr_err(" ERR: %d\n", retval);
return retval;
}
@@ -212,15 +213,13 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap,
eio:
retval = -EIO;
if (i2c_debug)
- printk(KERN_ERR " ERR: %d\n", retval);
+ pr_err(" ERR: %d\n", retval);
return retval;
}
static int i2c_xfer(struct i2c_adapter *i2c_adap,
struct i2c_msg *msgs, int num)
{
- struct cx23885_i2c *bus = i2c_adap->algo_data;
- struct cx23885_dev *dev = bus->dev;
int i, retval = 0;
dprintk(1, "%s(num = %d)\n", __func__, num);
@@ -302,7 +301,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
rc = i2c_master_recv(c, &buf, 0);
if (rc < 0)
continue;
- printk(KERN_INFO "%s: i2c scan: found device @ 0x%04x [%s]\n",
+ pr_info("%s: i2c scan: found device @ 0x%04x [%s]\n",
name, i, i2c_devs[i] ? i2c_devs[i] : "???");
}
}
@@ -330,12 +329,12 @@ int cx23885_i2c_register(struct cx23885_i2c *bus)
if (0 == bus->i2c_rc) {
dprintk(1, "%s: i2c bus %d registered\n", dev->name, bus->nr);
if (i2c_scan) {
- printk(KERN_INFO "%s: scan bus %d:\n",
+ pr_info("%s: scan bus %d:\n",
dev->name, bus->nr);
do_i2c_scan(dev->name, &bus->i2c_client);
}
} else
- printk(KERN_WARNING "%s: i2c bus %d register FAILED\n",
+ pr_warn("%s: i2c bus %d register FAILED\n",
dev->name, bus->nr);
/* Instantiate the IR receiver device, if present */