diff options
author | Sean Young <sean@mess.org> | 2017-10-18 09:39:12 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-14 09:58:19 -0500 |
commit | afc7f24c01034b7820365d9fa64822504b4dc35d (patch) | |
tree | 11edc7d5e33bb51d261db09cbe5b86c4dfd988da /drivers/media/i2c | |
parent | ef94711a04027066c4ae77d3477a5a4e0ba0784f (diff) | |
download | linux-afc7f24c01034b7820365d9fa64822504b4dc35d.tar.bz2 |
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 <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/ir-kbd-i2c.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/media/i2c/ir-kbd-i2c.c b/drivers/media/i2c/ir-kbd-i2c.c index 8b5f7d0435e4..27e36f45286c 100644 --- a/drivers/media/i2c/ir-kbd-i2c.c +++ b/drivers/media/i2c/ir-kbd-i2c.c @@ -439,12 +439,9 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) goto err_out_free; } - /* Sets name */ - snprintf(ir->name, sizeof(ir->name), "i2c IR (%s)", name); ir->ir_codes = ir_codes; - snprintf(ir->phys, sizeof(ir->phys), "%s/%s/ir0", - dev_name(&adap->dev), + snprintf(ir->phys, sizeof(ir->phys), "%s/%s", dev_name(&adap->dev), dev_name(&client->dev)); /* @@ -453,7 +450,8 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) */ rc->input_id.bustype = BUS_I2C; rc->input_phys = ir->phys; - rc->device_name = ir->name; + rc->device_name = name; + rc->dev.parent = &client->dev; /* * 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) if (err) goto err_out_free; - printk(MODULE_NAME ": %s detected at %s [%s]\n", - ir->name, ir->phys, adap->name); - /* start polling via eventd */ INIT_DELAYED_WORK(&ir->work, ir_work); schedule_delayed_work(&ir->work, 0); |