[media] rc: fix sysfs entry for mceusb and streamzap

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.

Signed-off-by: Paul Bender <pebender@gmail.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by Paul Bender and committed by Mauro Carvalho Chehab 635f76b2 1338c925

+10 -3
+5 -2
drivers/media/IR/mceusb.c
··· 35 #include <linux/device.h> 36 #include <linux/module.h> 37 #include <linux/slab.h> 38 - #include <linux/usb.h> 39 #include <linux/input.h> 40 #include <media/ir-core.h> 41 - #include <media/ir-common.h> 42 43 #define DRIVER_VERSION "1.91" 44 #define DRIVER_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" ··· 1078 } 1079 1080 ir->props = props; 1081 1082 if (mceusb_model[ir->model].rc_map) 1083 rc_map = mceusb_model[ir->model].rc_map;
··· 35 #include <linux/device.h> 36 #include <linux/module.h> 37 #include <linux/slab.h> 38 #include <linux/input.h> 39 + #include <linux/usb.h> 40 + #include <linux/usb/input.h> 41 #include <media/ir-core.h> 42 43 #define DRIVER_VERSION "1.91" 44 #define DRIVER_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" ··· 1078 } 1079 1080 ir->props = props; 1081 + 1082 + usb_to_input_id(ir->usbdev, &idev->id); 1083 + idev->dev.parent = ir->dev; 1084 1085 if (mceusb_model[ir->model].rc_map) 1086 rc_map = mceusb_model[ir->model].rc_map;
+5 -1
drivers/media/IR/streamzap.c
··· 34 #include <linux/device.h> 35 #include <linux/module.h> 36 #include <linux/slab.h> 37 - #include <linux/usb.h> 38 #include <linux/input.h> 39 #include <media/ir-core.h> 40 41 #define DRIVER_VERSION "1.61" ··· 332 props->allowed_protos = IR_TYPE_ALL; 333 334 sz->props = props; 335 336 ret = ir_input_register(idev, RC_MAP_STREAMZAP, props, DRIVER_NAME); 337 if (ret < 0) {
··· 34 #include <linux/device.h> 35 #include <linux/module.h> 36 #include <linux/slab.h> 37 #include <linux/input.h> 38 + #include <linux/usb.h> 39 + #include <linux/usb/input.h> 40 #include <media/ir-core.h> 41 42 #define DRIVER_VERSION "1.61" ··· 331 props->allowed_protos = IR_TYPE_ALL; 332 333 sz->props = props; 334 + 335 + usb_to_input_id(sz->usbdev, &idev->id); 336 + idev->dev.parent = sz->dev; 337 338 ret = ir_input_register(idev, RC_MAP_STREAMZAP, props, DRIVER_NAME); 339 if (ret < 0) {