Skip to content

Commit afc7f24

Browse files
seanyoungmchehab
authored andcommitted
media: rc: i2c: set parent of rc device and improve name
With the parent set for the rc device, the messages clearly state that it is attached via i2c. The additional printk is unnecessary. These are the old messages: rc rc1: i2c IR (Hauppauge WinTV PVR-150 as /devices/virtual/rc/rc1 ir-kbd-i2c: i2c IR (Hauppauge WinTV PVR-150 detected at i2c-10/10-0071/ir0 [ivtv i2c driver #0] Now we simply get: rc rc1: Hauppauge WinTV PVR-150 as /devices/pci0000:00/0000:00:1e.0/0000:02:00.0/i2c-10/10-0071/rc/rc1 Note that we no longer copy the name. I've checked all call sites to verfiy this is not a problem. Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent ef94711 commit afc7f24

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

drivers/media/i2c/ir-kbd-i2c.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,9 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
439439
goto err_out_free;
440440
}
441441

442-
/* Sets name */
443-
snprintf(ir->name, sizeof(ir->name), "i2c IR (%s)", name);
444442
ir->ir_codes = ir_codes;
445443

446-
snprintf(ir->phys, sizeof(ir->phys), "%s/%s/ir0",
447-
dev_name(&adap->dev),
444+
snprintf(ir->phys, sizeof(ir->phys), "%s/%s", dev_name(&adap->dev),
448445
dev_name(&client->dev));
449446

450447
/*
@@ -453,7 +450,8 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
453450
*/
454451
rc->input_id.bustype = BUS_I2C;
455452
rc->input_phys = ir->phys;
456-
rc->device_name = ir->name;
453+
rc->device_name = name;
454+
rc->dev.parent = &client->dev;
457455

458456
/*
459457
* Initialize the other fields of rc_dev
@@ -467,9 +465,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
467465
if (err)
468466
goto err_out_free;
469467

470-
printk(MODULE_NAME ": %s detected at %s [%s]\n",
471-
ir->name, ir->phys, adap->name);
472-
473468
/* start polling via eventd */
474469
INIT_DELAYED_WORK(&ir->work, ir_work);
475470
schedule_delayed_work(&ir->work, 0);

drivers/media/pci/saa7134/saa7134-input.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ MODULE_PARM_DESC(pinnacle_remote, "Specify Pinnacle PCTV remote: 0=coloured, 1=g
4343
} while (0)
4444
#define ir_dbg(ir, fmt, arg...) do { \
4545
if (ir_debug) \
46-
printk(KERN_DEBUG pr_fmt("ir %s: " fmt), ir->name, ## arg); \
46+
printk(KERN_DEBUG pr_fmt("ir %s: " fmt), ir->rc->device_name, \
47+
## arg); \
4748
} while (0)
4849

4950
/* Helper function for raw decoding at GPIO16 or GPIO18 */

include/media/i2c/ir-kbd-i2c.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ struct IR_i2c {
1919
u32 polling_interval; /* in ms */
2020

2121
struct delayed_work work;
22-
char name[32];
2322
char phys[32];
2423
int (*get_key)(struct IR_i2c *ir,
2524
enum rc_proto *protocol,

0 commit comments

Comments
 (0)