aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ir-kbd-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/ir-kbd-i2c.c')
-rw-r--r--drivers/media/video/ir-kbd-i2c.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index dabafdf71e60..11c5fdedc23b 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -50,7 +50,7 @@
50static int debug; 50static int debug;
51module_param(debug, int, 0644); /* debug level (0,1,2) */ 51module_param(debug, int, 0644); /* debug level (0,1,2) */
52 52
53static int hauppauge = 0; 53static int hauppauge;
54module_param(hauppauge, int, 0644); /* Choose Hauppauge remote */ 54module_param(hauppauge, int, 0644); /* Choose Hauppauge remote */
55MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults to 0)"); 55MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults to 0)");
56 56
@@ -153,7 +153,7 @@ static int get_key_fusionhdtv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
153 } 153 }
154 154
155 if(buf[0] !=0 || buf[1] !=0 || buf[2] !=0 || buf[3] != 0) 155 if(buf[0] !=0 || buf[1] !=0 || buf[2] !=0 || buf[3] != 0)
156 dprintk(2, "%s: 0x%2x 0x%2x 0x%2x 0x%2x\n", __FUNCTION__, 156 dprintk(2, "%s: 0x%2x 0x%2x 0x%2x 0x%2x\n", __func__,
157 buf[0], buf[1], buf[2], buf[3]); 157 buf[0], buf[1], buf[2], buf[3]);
158 158
159 /* no key pressed or signal from other ir remote */ 159 /* no key pressed or signal from other ir remote */
@@ -508,10 +508,10 @@ static int ir_probe(struct i2c_adapter *adap)
508 static const int probe_em28XX[] = { 0x30, 0x47, -1 }; 508 static const int probe_em28XX[] = { 0x30, 0x47, -1 };
509 static const int probe_cx88[] = { 0x18, 0x6b, 0x71, -1 }; 509 static const int probe_cx88[] = { 0x18, 0x6b, 0x71, -1 };
510 static const int probe_cx23885[] = { 0x6b, -1 }; 510 static const int probe_cx23885[] = { 0x6b, -1 };
511 const int *probe = NULL; 511 const int *probe;
512 struct i2c_client c; 512 struct i2c_client *c;
513 unsigned char buf; 513 unsigned char buf;
514 int i,rc; 514 int i, rc;
515 515
516 switch (adap->id) { 516 switch (adap->id) {
517 case I2C_HW_B_BT848: 517 case I2C_HW_B_BT848:
@@ -532,23 +532,27 @@ static int ir_probe(struct i2c_adapter *adap)
532 case I2C_HW_B_CX23885: 532 case I2C_HW_B_CX23885:
533 probe = probe_cx23885; 533 probe = probe_cx23885;
534 break; 534 break;
535 } 535 default:
536 if (NULL == probe)
537 return 0; 536 return 0;
537 }
538
539 c = kzalloc(sizeof(*c), GFP_KERNEL);
540 if (!c)
541 return -ENOMEM;
538 542
539 memset(&c,0,sizeof(c)); 543 c->adapter = adap;
540 c.adapter = adap;
541 for (i = 0; -1 != probe[i]; i++) { 544 for (i = 0; -1 != probe[i]; i++) {
542 c.addr = probe[i]; 545 c->addr = probe[i];
543 rc = i2c_master_recv(&c,&buf,0); 546 rc = i2c_master_recv(c, &buf, 0);
544 dprintk(1,"probe 0x%02x @ %s: %s\n", 547 dprintk(1,"probe 0x%02x @ %s: %s\n",
545 probe[i], adap->name, 548 probe[i], adap->name,
546 (0 == rc) ? "yes" : "no"); 549 (0 == rc) ? "yes" : "no");
547 if (0 == rc) { 550 if (0 == rc) {
548 ir_attach(adap,probe[i],0,0); 551 ir_attach(adap, probe[i], 0, 0);
549 break; 552 break;
550 } 553 }
551 } 554 }
555 kfree(c);
552 return 0; 556 return 0;
553} 557}
554 558