HID: switch to using input_dev->dev.parent
In preparation for struct class_device -> struct device input core conversion switch to using input_dev->dev.parent when specifying device position in sysfs tree. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
fed76ab3b2
commit
e071298589
|
@ -244,7 +244,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
|||
struct hid_usage *usage)
|
||||
{
|
||||
struct input_dev *input = hidinput->input;
|
||||
struct hid_device *device = input->private;
|
||||
struct hid_device *device = input_get_drvdata(input);
|
||||
int max = 0, code;
|
||||
unsigned long *bit = NULL;
|
||||
|
||||
|
@ -859,13 +859,15 @@ EXPORT_SYMBOL_GPL(hidinput_find_field);
|
|||
|
||||
static int hidinput_open(struct input_dev *dev)
|
||||
{
|
||||
struct hid_device *hid = dev->private;
|
||||
struct hid_device *hid = input_get_drvdata(dev);
|
||||
|
||||
return hid->hid_open(hid);
|
||||
}
|
||||
|
||||
static void hidinput_close(struct input_dev *dev)
|
||||
{
|
||||
struct hid_device *hid = dev->private;
|
||||
struct hid_device *hid = input_get_drvdata(dev);
|
||||
|
||||
hid->hid_close(hid);
|
||||
}
|
||||
|
||||
|
@ -913,7 +915,7 @@ int hidinput_connect(struct hid_device *hid)
|
|||
return -1;
|
||||
}
|
||||
|
||||
input_dev->private = hid;
|
||||
input_set_drvdata(input_dev, hid);
|
||||
input_dev->event = hid->hidinput_input_event;
|
||||
input_dev->open = hidinput_open;
|
||||
input_dev->close = hidinput_close;
|
||||
|
@ -925,7 +927,7 @@ int hidinput_connect(struct hid_device *hid)
|
|||
input_dev->id.vendor = hid->vendor;
|
||||
input_dev->id.product = hid->product;
|
||||
input_dev->id.version = hid->version;
|
||||
input_dev->cdev.dev = hid->dev;
|
||||
input_dev->dev.parent = hid->dev;
|
||||
hidinput->input = input_dev;
|
||||
list_add_tail(&hidinput->list, &hid->inputs);
|
||||
}
|
||||
|
|
|
@ -446,7 +446,7 @@ void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, uns
|
|||
|
||||
static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
|
||||
{
|
||||
struct hid_device *hid = dev->private;
|
||||
struct hid_device *hid = input_get_drvdata(dev);
|
||||
struct hid_field *field;
|
||||
int offset;
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ static const struct dev_type devices[] = {
|
|||
|
||||
static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *effect)
|
||||
{
|
||||
struct hid_device *hid = dev->private;
|
||||
struct hid_device *hid = input_get_drvdata(dev);
|
||||
struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
|
||||
struct hid_report *report = list_entry(report_list->next, struct hid_report, list);
|
||||
int x, y;
|
||||
|
|
|
@ -37,7 +37,7 @@ struct plff_device {
|
|||
static int hid_plff_play(struct input_dev *dev, void *data,
|
||||
struct ff_effect *effect)
|
||||
{
|
||||
struct hid_device *hid = dev->private;
|
||||
struct hid_device *hid = input_get_drvdata(dev);
|
||||
struct plff_device *plff = data;
|
||||
int left, right;
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ static inline int hid_tmff_scale(unsigned int in, int minimum, int maximum)
|
|||
|
||||
static int hid_tmff_play(struct input_dev *dev, void *data, struct ff_effect *effect)
|
||||
{
|
||||
struct hid_device *hid = dev->private;
|
||||
struct hid_device *hid = input_get_drvdata(dev);
|
||||
struct tmff_device *tmff = data;
|
||||
int left, right; /* Rumbling */
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ struct zpff_device {
|
|||
static int hid_zpff_play(struct input_dev *dev, void *data,
|
||||
struct ff_effect *effect)
|
||||
{
|
||||
struct hid_device *hid = dev->private;
|
||||
struct hid_device *hid = input_get_drvdata(dev);
|
||||
struct zpff_device *zpff = data;
|
||||
int left, right;
|
||||
|
||||
|
|
|
@ -133,12 +133,11 @@ resubmit:
|
|||
static int usb_kbd_event(struct input_dev *dev, unsigned int type,
|
||||
unsigned int code, int value)
|
||||
{
|
||||
struct usb_kbd *kbd = dev->private;
|
||||
struct usb_kbd *kbd = input_get_drvdata(dev);
|
||||
|
||||
if (type != EV_LED)
|
||||
return -1;
|
||||
|
||||
|
||||
kbd->newleds = (!!test_bit(LED_KANA, dev->led) << 3) | (!!test_bit(LED_COMPOSE, dev->led) << 3) |
|
||||
(!!test_bit(LED_SCROLLL, dev->led) << 2) | (!!test_bit(LED_CAPSL, dev->led) << 1) |
|
||||
(!!test_bit(LED_NUML, dev->led));
|
||||
|
@ -175,7 +174,7 @@ static void usb_kbd_led(struct urb *urb)
|
|||
|
||||
static int usb_kbd_open(struct input_dev *dev)
|
||||
{
|
||||
struct usb_kbd *kbd = dev->private;
|
||||
struct usb_kbd *kbd = input_get_drvdata(dev);
|
||||
|
||||
kbd->irq->dev = kbd->usbdev;
|
||||
if (usb_submit_urb(kbd->irq, GFP_KERNEL))
|
||||
|
@ -186,7 +185,7 @@ static int usb_kbd_open(struct input_dev *dev)
|
|||
|
||||
static void usb_kbd_close(struct input_dev *dev)
|
||||
{
|
||||
struct usb_kbd *kbd = dev->private;
|
||||
struct usb_kbd *kbd = input_get_drvdata(dev);
|
||||
|
||||
usb_kill_urb(kbd->irq);
|
||||
}
|
||||
|
@ -271,8 +270,9 @@ static int usb_kbd_probe(struct usb_interface *iface,
|
|||
input_dev->name = kbd->name;
|
||||
input_dev->phys = kbd->phys;
|
||||
usb_to_input_id(dev, &input_dev->id);
|
||||
input_dev->cdev.dev = &iface->dev;
|
||||
input_dev->private = kbd;
|
||||
input_dev->dev.parent = &iface->dev;
|
||||
|
||||
input_set_drvdata(input_dev, kbd);
|
||||
|
||||
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP);
|
||||
input_dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL) | BIT(LED_COMPOSE) | BIT(LED_KANA);
|
||||
|
|
|
@ -96,7 +96,7 @@ resubmit:
|
|||
|
||||
static int usb_mouse_open(struct input_dev *dev)
|
||||
{
|
||||
struct usb_mouse *mouse = dev->private;
|
||||
struct usb_mouse *mouse = input_get_drvdata(dev);
|
||||
|
||||
mouse->irq->dev = mouse->usbdev;
|
||||
if (usb_submit_urb(mouse->irq, GFP_KERNEL))
|
||||
|
@ -107,7 +107,7 @@ static int usb_mouse_open(struct input_dev *dev)
|
|||
|
||||
static void usb_mouse_close(struct input_dev *dev)
|
||||
{
|
||||
struct usb_mouse *mouse = dev->private;
|
||||
struct usb_mouse *mouse = input_get_drvdata(dev);
|
||||
|
||||
usb_kill_urb(mouse->irq);
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
|
|||
input_dev->name = mouse->name;
|
||||
input_dev->phys = mouse->phys;
|
||||
usb_to_input_id(dev, &input_dev->id);
|
||||
input_dev->cdev.dev = &intf->dev;
|
||||
input_dev->dev.parent = &intf->dev;
|
||||
|
||||
input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
|
||||
input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
|
||||
|
@ -179,7 +179,8 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
|
|||
input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA);
|
||||
input_dev->relbit[0] |= BIT(REL_WHEEL);
|
||||
|
||||
input_dev->private = mouse;
|
||||
input_set_drvdata(input_dev, mouse);
|
||||
|
||||
input_dev->open = usb_mouse_open;
|
||||
input_dev->close = usb_mouse_close;
|
||||
|
||||
|
|
Loading…
Reference in New Issue