diff options
author | Steven Toth <stoth@linuxtv.org> | 2008-10-16 19:18:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-17 16:27:23 -0400 |
commit | 9c8ced511e154faf1a7af3f1abdfff45dccbe54a (patch) | |
tree | 6c609e6124c7999abbc6df6410545ae0ba5e9bc2 /drivers/media/video/cx23885/cx23885-i2c.c | |
parent | 2af03eeadf460656642c2553c783537e7ad02875 (diff) |
V4L/DVB (9251): cx23885: Checkpatch compliance
cx23885: Checkpatch compliance
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-i2c.c')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-i2c.c | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/drivers/media/video/cx23885/cx23885-i2c.c b/drivers/media/video/cx23885/cx23885-i2c.c index f98e476e961..bb7f71a1fcb 100644 --- a/drivers/media/video/cx23885/cx23885-i2c.c +++ b/drivers/media/video/cx23885/cx23885-i2c.c | |||
@@ -131,7 +131,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, | |||
131 | printk(" >\n"); | 131 | printk(" >\n"); |
132 | } | 132 | } |
133 | 133 | ||
134 | for (cnt = 1; cnt < msg->len; cnt++ ) { | 134 | for (cnt = 1; cnt < msg->len; cnt++) { |
135 | /* following bytes */ | 135 | /* following bytes */ |
136 | wdata = msg->buf[cnt]; | 136 | wdata = msg->buf[cnt]; |
137 | ctrl = bus->i2c_period | (1 << 12) | (1 << 2); | 137 | ctrl = bus->i2c_period | (1 << 12) | (1 << 2); |
@@ -151,9 +151,9 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, | |||
151 | if (retval == 0) | 151 | if (retval == 0) |
152 | goto eio; | 152 | goto eio; |
153 | if (i2c_debug) { | 153 | if (i2c_debug) { |
154 | printk(" %02x", msg->buf[cnt]); | 154 | dprintk(1, " %02x", msg->buf[cnt]); |
155 | if (!(ctrl & I2C_NOSTOP)) | 155 | if (!(ctrl & I2C_NOSTOP)) |
156 | printk(" >\n"); | 156 | dprintk(1, " >\n"); |
157 | } | 157 | } |
158 | } | 158 | } |
159 | return msg->len; | 159 | return msg->len; |
@@ -162,7 +162,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, | |||
162 | retval = -EIO; | 162 | retval = -EIO; |
163 | err: | 163 | err: |
164 | if (i2c_debug) | 164 | if (i2c_debug) |
165 | printk(" ERR: %d\n", retval); | 165 | printk(KERN_ERR " ERR: %d\n", retval); |
166 | return retval; | 166 | return retval; |
167 | } | 167 | } |
168 | 168 | ||
@@ -194,12 +194,12 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, | |||
194 | 194 | ||
195 | if (i2c_debug) { | 195 | if (i2c_debug) { |
196 | if (joined) | 196 | if (joined) |
197 | printk(" R"); | 197 | dprintk(1, " R"); |
198 | else | 198 | else |
199 | printk(" <R %02x", (msg->addr << 1) + 1); | 199 | dprintk(1, " <R %02x", (msg->addr << 1) + 1); |
200 | } | 200 | } |
201 | 201 | ||
202 | for(cnt = 0; cnt < msg->len; cnt++) { | 202 | for (cnt = 0; cnt < msg->len; cnt++) { |
203 | 203 | ||
204 | ctrl = bus->i2c_period | (1 << 12) | (1 << 2) | 1; | 204 | ctrl = bus->i2c_period | (1 << 12) | (1 << 2) | 1; |
205 | 205 | ||
@@ -216,9 +216,9 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, | |||
216 | goto eio; | 216 | goto eio; |
217 | msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff; | 217 | msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff; |
218 | if (i2c_debug) { | 218 | if (i2c_debug) { |
219 | printk(" %02x", msg->buf[cnt]); | 219 | dprintk(1, " %02x", msg->buf[cnt]); |
220 | if (!(ctrl & I2C_NOSTOP)) | 220 | if (!(ctrl & I2C_NOSTOP)) |
221 | printk(" >\n"); | 221 | dprintk(1, " >\n"); |
222 | } | 222 | } |
223 | } | 223 | } |
224 | return msg->len; | 224 | return msg->len; |
@@ -227,7 +227,7 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, | |||
227 | retval = -EIO; | 227 | retval = -EIO; |
228 | err: | 228 | err: |
229 | if (i2c_debug) | 229 | if (i2c_debug) |
230 | printk(" ERR: %d\n", retval); | 230 | printk(KERN_ERR " ERR: %d\n", retval); |
231 | return retval; | 231 | return retval; |
232 | } | 232 | } |
233 | 233 | ||
@@ -353,17 +353,17 @@ static struct i2c_client cx23885_i2c_client_template = { | |||
353 | }; | 353 | }; |
354 | 354 | ||
355 | static char *i2c_devs[128] = { | 355 | static char *i2c_devs[128] = { |
356 | [0x10 >> 1] = "tda10048", | 356 | [0x10 >> 1] = "tda10048", |
357 | [0x12 >> 1] = "dib7000pc", | 357 | [0x12 >> 1] = "dib7000pc", |
358 | [ 0x1c >> 1 ] = "lgdt3303", | 358 | [0x1c >> 1] = "lgdt3303", |
359 | [ 0x86 >> 1 ] = "tda9887", | 359 | [0x86 >> 1] = "tda9887", |
360 | [ 0x32 >> 1 ] = "cx24227", | 360 | [0x32 >> 1] = "cx24227", |
361 | [ 0x88 >> 1 ] = "cx25837", | 361 | [0x88 >> 1] = "cx25837", |
362 | [ 0x84 >> 1 ] = "tda8295", | 362 | [0x84 >> 1] = "tda8295", |
363 | [ 0xa0 >> 1 ] = "eeprom", | 363 | [0xa0 >> 1] = "eeprom", |
364 | [ 0xc0 >> 1 ] = "tuner/mt2131/tda8275", | 364 | [0xc0 >> 1] = "tuner/mt2131/tda8275", |
365 | [0xc2 >> 1] = "tuner/mt2131/tda8275/xc5000/xc3028", | 365 | [0xc2 >> 1] = "tuner/mt2131/tda8275/xc5000/xc3028", |
366 | [0xc8 >> 1] = "tuner/xc3028L", | 366 | [0xc8 >> 1] = "tuner/xc3028L", |
367 | }; | 367 | }; |
368 | 368 | ||
369 | static void do_i2c_scan(char *name, struct i2c_client *c) | 369 | static void do_i2c_scan(char *name, struct i2c_client *c) |
@@ -376,7 +376,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c) | |||
376 | rc = i2c_master_recv(c, &buf, 0); | 376 | rc = i2c_master_recv(c, &buf, 0); |
377 | if (rc < 0) | 377 | if (rc < 0) |
378 | continue; | 378 | continue; |
379 | printk("%s: i2c scan: found device @ 0x%x [%s]\n", | 379 | printk(KERN_INFO "%s: i2c scan: found device @ 0x%x [%s]\n", |
380 | name, i << 1, i2c_devs[i] ? i2c_devs[i] : "???"); | 380 | name, i << 1, i2c_devs[i] ? i2c_devs[i] : "???"); |
381 | } | 381 | } |
382 | } | 382 | } |
@@ -408,11 +408,12 @@ int cx23885_i2c_register(struct cx23885_i2c *bus) | |||
408 | bus->i2c_client.adapter = &bus->i2c_adap; | 408 | bus->i2c_client.adapter = &bus->i2c_adap; |
409 | 409 | ||
410 | if (0 == bus->i2c_rc) { | 410 | if (0 == bus->i2c_rc) { |
411 | printk("%s: i2c bus %d registered\n", dev->name, bus->nr); | 411 | dprintk(1, "%s: i2c bus %d registered\n", dev->name, bus->nr); |
412 | if (i2c_scan) | 412 | if (i2c_scan) |
413 | do_i2c_scan(dev->name, &bus->i2c_client); | 413 | do_i2c_scan(dev->name, &bus->i2c_client); |
414 | } else | 414 | } else |
415 | printk("%s: i2c bus %d register FAILED\n", dev->name, bus->nr); | 415 | printk(KERN_WARNING "%s: i2c bus %d register FAILED\n", |
416 | dev->name, bus->nr); | ||
416 | 417 | ||
417 | return bus->i2c_rc; | 418 | return bus->i2c_rc; |
418 | } | 419 | } |