Skip to content

Commit

Permalink
[media] rc: fix sysfs entry for mceusb and streamzap
Browse files Browse the repository at this point in the history
When trying to create persistent device names for mceusb and streamzap
devices, I noticed that their respective drivers are not creating the rc
device as a child of the USB device. Rather it creates it as virtual
device. As a result, udev cannot use the USB device information to
create persistent device names for event and lirc devices associated
with the rc device. Not having persistent device names makes it more

difficult to make use of the devices in userspace as their names can
change.

Forward-ported to media_tree staging/for_v2.6.38 and tested with
both streamzap and mceusb devices:
$ ll /dev/input/by-id/
...
lrwxrwxrwx. 1 root root 9 Nov 17 17:06 usb-Streamzap__Inc._Streamzap_Remote_Control-event-if00 -> ../event6
lrwxrwxrwx. 1 root root 9 Nov 17 17:05 usb-Topseed_Technology_Corp._eHome_Infrared_Transceiver_TS000BzY-event-if00 -> ../event5
Previously, nada.

Signed-off-by: Paul Bender <pebender@gmail.com>
Tested-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Paul Bender authored and Mauro Carvalho Chehab committed Dec 29, 2010
1 parent 5df465d commit 5ad1a55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/rc/mceusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir)

snprintf(ir->name, sizeof(ir->name), "%s (%04x:%04x)",
mceusb_model[ir->model].name ?
mceusb_model[ir->model].name :
mceusb_model[ir->model].name :
"Media Center Ed. eHome Infrared Remote Transceiver",
le16_to_cpu(ir->usbdev->descriptor.idVendor),
le16_to_cpu(ir->usbdev->descriptor.idProduct));
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/rc/streamzap.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ static struct rc_dev *streamzap_init_rc_dev(struct streamzap_ir *sz)

rdev->input_name = sz->name;
rdev->input_phys = sz->phys;
usb_to_input_id(sz->usbdev, &rdev->input_id);
rdev->dev.parent = dev;
rdev->priv = sz;
rdev->driver_type = RC_DRIVER_IR_RAW;
rdev->allowed_protos = RC_TYPE_ALL;
Expand Down

0 comments on commit 5ad1a55

Please sign in to comment.