Commit 7c379146 authored by Jiri Kosina's avatar Jiri Kosina

HID: API - fix leftovers of hidinput API in USB HID

hidinput_{open,close}() functions do not belong to usbhid, but
to the generic HID layer. Move them, and fix hooks in struct
hid_device, so that now the callbacks are done to transport-specific
_open() functions, but not input_open() functions.
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent c080d89a
...@@ -805,6 +805,18 @@ int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int ...@@ -805,6 +805,18 @@ int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int
} }
EXPORT_SYMBOL_GPL(hidinput_find_field); EXPORT_SYMBOL_GPL(hidinput_find_field);
static int hidinput_open(struct input_dev *dev)
{
struct hid_device *hid = dev->private;
return hid->hid_open(hid);
}
static void hidinput_close(struct input_dev *dev)
{
struct hid_device *hid = dev->private;
hid->hid_close(hid);
}
/* /*
* Register the input device; print a message. * Register the input device; print a message.
* Configure the input layer interface * Configure the input layer interface
...@@ -851,8 +863,8 @@ int hidinput_connect(struct hid_device *hid) ...@@ -851,8 +863,8 @@ int hidinput_connect(struct hid_device *hid)
input_dev->private = hid; input_dev->private = hid;
input_dev->event = hid->hidinput_input_event; input_dev->event = hid->hidinput_input_event;
input_dev->open = hid->hidinput_open; input_dev->open = hidinput_open;
input_dev->close = hid->hidinput_close; input_dev->close = hidinput_close;
input_dev->name = hid->name; input_dev->name = hid->name;
input_dev->phys = hid->phys; input_dev->phys = hid->phys;
......
...@@ -529,18 +529,6 @@ void usbhid_close(struct hid_device *hid) ...@@ -529,18 +529,6 @@ void usbhid_close(struct hid_device *hid)
usb_kill_urb(usbhid->urbin); usb_kill_urb(usbhid->urbin);
} }
static int hidinput_open(struct input_dev *dev)
{
struct hid_device *hid = dev->private;
return usbhid_open(hid);
}
static void hidinput_close(struct input_dev *dev)
{
struct hid_device *hid = dev->private;
usbhid_close(hid);
}
#define USB_VENDOR_ID_PANJIT 0x134c #define USB_VENDOR_ID_PANJIT 0x134c
#define USB_VENDOR_ID_TURBOX 0x062a #define USB_VENDOR_ID_TURBOX 0x062a
...@@ -1241,8 +1229,8 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) ...@@ -1241,8 +1229,8 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma; usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma;
usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP);
hid->hidinput_input_event = usb_hidinput_input_event; hid->hidinput_input_event = usb_hidinput_input_event;
hid->hidinput_open = hidinput_open; hid->hid_open = usbhid_open;
hid->hidinput_close = hidinput_close; hid->hid_close = usbhid_close;
#ifdef CONFIG_USB_HIDDEV #ifdef CONFIG_USB_HIDDEV
hid->hiddev_hid_event = hiddev_hid_event; hid->hiddev_hid_event = hiddev_hid_event;
hid->hiddev_report_event = hiddev_report_event; hid->hiddev_report_event = hiddev_report_event;
......
...@@ -431,8 +431,8 @@ struct hid_device { /* device report descriptor */ ...@@ -431,8 +431,8 @@ struct hid_device { /* device report descriptor */
/* device-specific function pointers */ /* device-specific function pointers */
int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int); int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int);
int (*hidinput_open) (struct input_dev *); int (*hid_open) (struct hid_device *);
void (*hidinput_close) (struct input_dev *); void (*hid_close) (struct hid_device *);
/* hiddev event handler */ /* hiddev event handler */
void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment