aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ir-kbd-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:25:21 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:25:21 -0500
commitd21838dd7d098e102ced2fafed62dcb133c4d71c (patch)
treeed8a319559745e9286a1ee1cf0067e08b202b066 /drivers/media/video/ir-kbd-i2c.c
parentb060c25f70adb20532dacefa72029d1d2db1a7f1 (diff)
V4L/DVB (3123b): syncs V4L subsystem tree with kernel
- This patch makes kernel in sync with v4l subsystem tree. - some lines reordered to be sync. - some reduntant codes removed. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/video/ir-kbd-i2c.c')
-rw-r--r--drivers/media/video/ir-kbd-i2c.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 3cc1d6a6019b..caa0f58d149e 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -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);