diff options
author | YAMANE Toshiaki <yamanetoshi@gmail.com> | 2012-11-02 03:48:48 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-12-21 15:25:16 -0500 |
commit | 011b2aad587a770e758711f465312ac843440d2a (patch) | |
tree | 6f0fab7b6e391659292b86b364d0840ea608ee80 /drivers/staging | |
parent | ed2e33011451f655052ff1d3aa9ee936057d508b (diff) |
[media] staging/media: Use dev_ printks in cxd2099/cxd2099.[ch]
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ...
Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
Tested-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/cxd2099/cxd2099.c | 29 | ||||
-rw-r--r-- | drivers/staging/media/cxd2099/cxd2099.h | 2 |
2 files changed, 16 insertions, 15 deletions
diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c index 0ff19724992f..822c487592a4 100644 --- a/drivers/staging/media/cxd2099/cxd2099.c +++ b/drivers/staging/media/cxd2099/cxd2099.c | |||
@@ -66,8 +66,9 @@ static int i2c_write_reg(struct i2c_adapter *adapter, u8 adr, | |||
66 | struct i2c_msg msg = {.addr = adr, .flags = 0, .buf = m, .len = 2}; | 66 | struct i2c_msg msg = {.addr = adr, .flags = 0, .buf = m, .len = 2}; |
67 | 67 | ||
68 | if (i2c_transfer(adapter, &msg, 1) != 1) { | 68 | if (i2c_transfer(adapter, &msg, 1) != 1) { |
69 | printk(KERN_ERR "Failed to write to I2C register %02x@%02x!\n", | 69 | dev_err(&adapter->dev, |
70 | reg, adr); | 70 | "Failed to write to I2C register %02x@%02x!\n", |
71 | reg, adr); | ||
71 | return -1; | 72 | return -1; |
72 | } | 73 | } |
73 | return 0; | 74 | return 0; |
@@ -79,7 +80,7 @@ static int i2c_write(struct i2c_adapter *adapter, u8 adr, | |||
79 | struct i2c_msg msg = {.addr = adr, .flags = 0, .buf = data, .len = len}; | 80 | struct i2c_msg msg = {.addr = adr, .flags = 0, .buf = data, .len = len}; |
80 | 81 | ||
81 | if (i2c_transfer(adapter, &msg, 1) != 1) { | 82 | if (i2c_transfer(adapter, &msg, 1) != 1) { |
82 | printk(KERN_ERR "Failed to write to I2C!\n"); | 83 | dev_err(&adapter->dev, "Failed to write to I2C!\n"); |
83 | return -1; | 84 | return -1; |
84 | } | 85 | } |
85 | return 0; | 86 | return 0; |
@@ -94,7 +95,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter, u8 adr, | |||
94 | .buf = val, .len = 1} }; | 95 | .buf = val, .len = 1} }; |
95 | 96 | ||
96 | if (i2c_transfer(adapter, msgs, 2) != 2) { | 97 | if (i2c_transfer(adapter, msgs, 2) != 2) { |
97 | printk(KERN_ERR "error in i2c_read_reg\n"); | 98 | dev_err(&adapter->dev, "error in i2c_read_reg\n"); |
98 | return -1; | 99 | return -1; |
99 | } | 100 | } |
100 | return 0; | 101 | return 0; |
@@ -109,7 +110,7 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr, | |||
109 | .buf = data, .len = n} }; | 110 | .buf = data, .len = n} }; |
110 | 111 | ||
111 | if (i2c_transfer(adapter, msgs, 2) != 2) { | 112 | if (i2c_transfer(adapter, msgs, 2) != 2) { |
112 | printk(KERN_ERR "error in i2c_read\n"); | 113 | dev_err(&adapter->dev, "error in i2c_read\n"); |
113 | return -1; | 114 | return -1; |
114 | } | 115 | } |
115 | return 0; | 116 | return 0; |
@@ -277,7 +278,7 @@ static void cam_mode(struct cxd *ci, int mode) | |||
277 | #ifdef BUFFER_MODE | 278 | #ifdef BUFFER_MODE |
278 | if (!ci->en.read_data) | 279 | if (!ci->en.read_data) |
279 | return; | 280 | return; |
280 | printk(KERN_INFO "enable cam buffer mode\n"); | 281 | dev_info(&ci->i2c->dev, "enable cam buffer mode\n"); |
281 | /* write_reg(ci, 0x0d, 0x00); */ | 282 | /* write_reg(ci, 0x0d, 0x00); */ |
282 | /* write_reg(ci, 0x0e, 0x01); */ | 283 | /* write_reg(ci, 0x0e, 0x01); */ |
283 | write_regm(ci, 0x08, 0x40, 0x40); | 284 | write_regm(ci, 0x08, 0x40, 0x40); |
@@ -524,7 +525,7 @@ static int slot_reset(struct dvb_ca_en50221 *ca, int slot) | |||
524 | msleep(10); | 525 | msleep(10); |
525 | #if 0 | 526 | #if 0 |
526 | read_reg(ci, 0x06, &val); | 527 | read_reg(ci, 0x06, &val); |
527 | printk(KERN_INFO "%d:%02x\n", i, val); | 528 | dev_info(&ci->i2c->dev, "%d:%02x\n", i, val); |
528 | if (!(val&0x10)) | 529 | if (!(val&0x10)) |
529 | break; | 530 | break; |
530 | #else | 531 | #else |
@@ -542,7 +543,7 @@ static int slot_shutdown(struct dvb_ca_en50221 *ca, int slot) | |||
542 | { | 543 | { |
543 | struct cxd *ci = ca->data; | 544 | struct cxd *ci = ca->data; |
544 | 545 | ||
545 | printk(KERN_INFO "slot_shutdown\n"); | 546 | dev_info(&ci->i2c->dev, "slot_shutdown\n"); |
546 | mutex_lock(&ci->lock); | 547 | mutex_lock(&ci->lock); |
547 | write_regm(ci, 0x09, 0x08, 0x08); | 548 | write_regm(ci, 0x09, 0x08, 0x08); |
548 | write_regm(ci, 0x20, 0x80, 0x80); /* Reset CAM Mode */ | 549 | write_regm(ci, 0x20, 0x80, 0x80); /* Reset CAM Mode */ |
@@ -578,10 +579,10 @@ static int campoll(struct cxd *ci) | |||
578 | 579 | ||
579 | if (istat&0x40) { | 580 | if (istat&0x40) { |
580 | ci->dr = 1; | 581 | ci->dr = 1; |
581 | printk(KERN_INFO "DR\n"); | 582 | dev_info(&ci->i2c->dev, "DR\n"); |
582 | } | 583 | } |
583 | if (istat&0x20) | 584 | if (istat&0x20) |
584 | printk(KERN_INFO "WC\n"); | 585 | dev_info(&ci->i2c->dev, "WC\n"); |
585 | 586 | ||
586 | if (istat&2) { | 587 | if (istat&2) { |
587 | u8 slotstat; | 588 | u8 slotstat; |
@@ -597,7 +598,7 @@ static int campoll(struct cxd *ci) | |||
597 | if (ci->slot_stat) { | 598 | if (ci->slot_stat) { |
598 | ci->slot_stat = 0; | 599 | ci->slot_stat = 0; |
599 | write_regm(ci, 0x03, 0x00, 0x08); | 600 | write_regm(ci, 0x03, 0x00, 0x08); |
600 | printk(KERN_INFO "NO CAM\n"); | 601 | dev_info(&ci->i2c->dev, "NO CAM\n"); |
601 | ci->ready = 0; | 602 | ci->ready = 0; |
602 | } | 603 | } |
603 | } | 604 | } |
@@ -634,7 +635,7 @@ static int read_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount) | |||
634 | campoll(ci); | 635 | campoll(ci); |
635 | mutex_unlock(&ci->lock); | 636 | mutex_unlock(&ci->lock); |
636 | 637 | ||
637 | printk(KERN_INFO "read_data\n"); | 638 | dev_info(&ci->i2c->dev, "read_data\n"); |
638 | if (!ci->dr) | 639 | if (!ci->dr) |
639 | return 0; | 640 | return 0; |
640 | 641 | ||
@@ -687,7 +688,7 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg, | |||
687 | u8 val; | 688 | u8 val; |
688 | 689 | ||
689 | if (i2c_read_reg(i2c, cfg->adr, 0, &val) < 0) { | 690 | if (i2c_read_reg(i2c, cfg->adr, 0, &val) < 0) { |
690 | printk(KERN_INFO "No CXD2099 detected at %02x\n", cfg->adr); | 691 | dev_info(&i2c->dev, "No CXD2099 detected at %02x\n", cfg->adr); |
691 | return NULL; | 692 | return NULL; |
692 | } | 693 | } |
693 | 694 | ||
@@ -705,7 +706,7 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg, | |||
705 | ci->en = en_templ; | 706 | ci->en = en_templ; |
706 | ci->en.data = ci; | 707 | ci->en.data = ci; |
707 | init(ci); | 708 | init(ci); |
708 | printk(KERN_INFO "Attached CXD2099AR at %02x\n", ci->cfg.adr); | 709 | dev_info(&i2c->dev, "Attached CXD2099AR at %02x\n", ci->cfg.adr); |
709 | return &ci->en; | 710 | return &ci->en; |
710 | } | 711 | } |
711 | EXPORT_SYMBOL(cxd2099_attach); | 712 | EXPORT_SYMBOL(cxd2099_attach); |
diff --git a/drivers/staging/media/cxd2099/cxd2099.h b/drivers/staging/media/cxd2099/cxd2099.h index 19c588a59588..0eb607c5b423 100644 --- a/drivers/staging/media/cxd2099/cxd2099.h +++ b/drivers/staging/media/cxd2099/cxd2099.h | |||
@@ -43,7 +43,7 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg, | |||
43 | static inline struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg, | 43 | static inline struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg, |
44 | void *priv, struct i2c_adapter *i2c) | 44 | void *priv, struct i2c_adapter *i2c) |
45 | { | 45 | { |
46 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | 46 | dev_warn(&i2c->dev, "%s: driver disabled by Kconfig\n", __func__); |
47 | return NULL; | 47 | return NULL; |
48 | } | 48 | } |
49 | #endif | 49 | #endif |