aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input/hid-ff.c
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@gmail.com>2007-01-19 12:28:17 -0500
committerJiri Kosina <jkosina@suse.cz>2007-01-21 16:18:01 -0500
commitbe8209753b014f2d7a92b2ec3ff82db478fc86d1 (patch)
tree2f5a1e5d5b7bbf18c2be569166b86ccd680e9081 /drivers/usb/input/hid-ff.c
parentf7ebf99eb489a02dba2e5a071fde9f5354275a50 (diff)
HID: put usb_interface instead of usb_device into hid->dev to fix udevinfo breakage
The commit 4916b3a57fc94664677d439b911b8aaf86c7ec23 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: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/usb/input/hid-ff.c')
-rw-r--r--drivers/usb/input/hid-ff.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c
index f8f660ee3fac..59ed65e7a621 100644
--- a/drivers/usb/input/hid-ff.c
+++ b/drivers/usb/input/hid-ff.c
@@ -33,6 +33,7 @@
33#include <linux/usb.h> 33#include <linux/usb.h>
34 34
35#include <linux/hid.h> 35#include <linux/hid.h>
36#include "usbhid.h"
36 37
37/* 38/*
38 * This table contains pointers to initializers. To add support for new 39 * This table contains pointers to initializers. To add support for new
@@ -70,8 +71,8 @@ static struct hid_ff_initializer inits[] = {
70int hid_ff_init(struct hid_device* hid) 71int hid_ff_init(struct hid_device* hid)
71{ 72{
72 struct hid_ff_initializer *init; 73 struct hid_ff_initializer *init;
73 int vendor = le16_to_cpu(to_usb_device(hid->dev)->descriptor.idVendor); 74 int vendor = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idVendor);
74 int product = le16_to_cpu(to_usb_device(hid->dev)->descriptor.idProduct); 75 int product = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idProduct);
75 76
76 for (init = inits; init->idVendor; init++) 77 for (init = inits; init->idVendor; init++)
77 if (init->idVendor == vendor && init->idProduct == product) 78 if (init->idVendor == vendor && init->idProduct == product)