• Anssi Hannula's avatar
    HID: put usb_interface instead of usb_device into hid->dev to fix udevinfo breakage · be820975
    Anssi Hannula authored
    The commit 4916b3a5 introduced a
    hid regression between 2.6.19 and 2.6.20-rc1. The device put in
    input_dev->cdev is now of type usb_device instead of usb_interface.
    
    Before:
    > # readlink -f /sys/class/input/input6/event4/device
    > /sys/devices/pci0000:00/0000:00:10.0/usb2/2-1/2-1:1.1
    After:
    > # readlink -f /sys/class/input/input3/event3/device
    > /sys/devices/pci0000:00/0000:00:10.0/usb1/1-1
    
    This causes breakage:
    > # udevinfo -q all -n /dev/input/event3
    > P: /class/input/input3/event3
    > N: input/event3
    > S: input/by-path/pci-1-1--event-
    > E: ID_SERIAL=noserial
    > E: ID_PATH=pci-1-1-
    
    No ID_MODEL, ID_VENDOR, ID_REVISION, ID_TYPE etc etc.
    
    Fix this by assigning the intf->dev into hid->dev, and fixing
    all the users.
    Signed-off-by: default avatarAnssi Hannula <anssi.hannula@gmail.com>
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
    be820975
hid-ff.c 2.61 KB