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.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 3cc1d6a6019b..58b0e6982822 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -279,7 +279,7 @@ static int ir_probe(struct i2c_adapter *adap);
279 279
280static struct i2c_driver driver = { 280static struct i2c_driver driver = {
281 .driver = { 281 .driver = {
282 .name = "ir remote kbd driver", 282 .name = "ir-kbd-i2c",
283 }, 283 },
284 .id = I2C_DRIVERID_INFRARED, 284 .id = I2C_DRIVERID_INFRARED,
285 .attach_adapter = ir_probe, 285 .attach_adapter = ir_probe,
@@ -304,18 +304,20 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
304 ir = kzalloc(sizeof(struct IR_i2c),GFP_KERNEL); 304 ir = kzalloc(sizeof(struct IR_i2c),GFP_KERNEL);
305 input_dev = input_allocate_device(); 305 input_dev = input_allocate_device();
306 if (!ir || !input_dev) { 306 if (!ir || !input_dev) {
307 kfree(ir);
308 input_free_device(input_dev); 307 input_free_device(input_dev);
308 kfree(ir);
309 return -ENOMEM; 309 return -ENOMEM;
310 } 310 }
311 memset(ir,0,sizeof(*ir));
311 312
312 ir->c = client_template; 313 ir->c = client_template;
313 ir->input = input_dev; 314 ir->input = input_dev;
314 315
315 i2c_set_clientdata(&ir->c, ir);
316 ir->c.adapter = adap; 316 ir->c.adapter = adap;
317 ir->c.addr = addr; 317 ir->c.addr = addr;
318 318
319 i2c_set_clientdata(&ir->c, ir);
320
319 switch(addr) { 321 switch(addr) {
320 case 0x64: 322 case 0x64:
321 name = "Pixelview"; 323 name = "Pixelview";
@@ -378,13 +380,15 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
378 ir->c.dev.bus_id); 380 ir->c.dev.bus_id);
379 381
380 /* init + register input device */ 382 /* init + register input device */
381 ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); 383 ir_input_init(input_dev,&ir->ir,ir_type,ir->ir_codes);
382 input_dev->id.bustype = BUS_I2C; 384 input_dev->id.bustype = BUS_I2C;
383 input_dev->name = ir->c.name; 385 input_dev->name = ir->c.name;
384 input_dev->phys = ir->phys; 386 input_dev->phys = ir->phys;
385 387
386 /* register event device */ 388 /* register event device */
387 input_register_device(ir->input); 389 input_register_device(ir->input);
390 printk(DEVNAME ": %s detected at %s [%s]\n",
391 ir->input->name,ir->input->phys,adap->name);
388 392
389 /* start polling via eventd */ 393 /* start polling via eventd */
390 INIT_WORK(&ir->work, ir_work, ir); 394 INIT_WORK(&ir->work, ir_work, ir);