aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2007-01-24 05:54:19 -0500
committerJiri Kosina <jkosina@suse.cz>2007-02-05 04:00:40 -0500
commit7c379146005d277982acde02da44c773de5e7e5a (patch)
tree8a1bbbdabd357f11ec84e5e793539863139ffa71
parentc080d89ad91e98fec0e8fc5f448a1ad899bd85c7 (diff)
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: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-input.c16
-rw-r--r--drivers/usb/input/hid-core.c16
-rw-r--r--include/linux/hid.h4
3 files changed, 18 insertions, 18 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index ae298c4bfcbd..4824b19b8646 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -805,6 +805,18 @@ int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int
805} 805}
806EXPORT_SYMBOL_GPL(hidinput_find_field); 806EXPORT_SYMBOL_GPL(hidinput_find_field);
807 807
808static int hidinput_open(struct input_dev *dev)
809{
810 struct hid_device *hid = dev->private;
811 return hid->hid_open(hid);
812}
813
814static void hidinput_close(struct input_dev *dev)
815{
816 struct hid_device *hid = dev->private;
817 hid->hid_close(hid);
818}
819
808/* 820/*
809 * Register the input device; print a message. 821 * Register the input device; print a message.
810 * Configure the input layer interface 822 * Configure the input layer interface
@@ -851,8 +863,8 @@ int hidinput_connect(struct hid_device *hid)
851 863
852 input_dev->private = hid; 864 input_dev->private = hid;
853 input_dev->event = hid->hidinput_input_event; 865 input_dev->event = hid->hidinput_input_event;
854 input_dev->open = hid->hidinput_open; 866 input_dev->open = hidinput_open;
855 input_dev->close = hid->hidinput_close; 867 input_dev->close = hidinput_close;
856 868
857 input_dev->name = hid->name; 869 input_dev->name = hid->name;
858 input_dev->phys = hid->phys; 870 input_dev->phys = hid->phys;
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 6938c4e0e5e2..0392d0e8d020 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -529,18 +529,6 @@ void usbhid_close(struct hid_device *hid)
529 usb_kill_urb(usbhid->urbin); 529 usb_kill_urb(usbhid->urbin);
530} 530}
531 531
532static int hidinput_open(struct input_dev *dev)
533{
534 struct hid_device *hid = dev->private;
535 return usbhid_open(hid);
536}
537
538static void hidinput_close(struct input_dev *dev)
539{
540 struct hid_device *hid = dev->private;
541 usbhid_close(hid);
542}
543
544#define USB_VENDOR_ID_PANJIT 0x134c 532#define USB_VENDOR_ID_PANJIT 0x134c
545 533
546#define USB_VENDOR_ID_TURBOX 0x062a 534#define USB_VENDOR_ID_TURBOX 0x062a
@@ -1241,8 +1229,8 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
1241 usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma; 1229 usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma;
1242 usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); 1230 usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP);
1243 hid->hidinput_input_event = usb_hidinput_input_event; 1231 hid->hidinput_input_event = usb_hidinput_input_event;
1244 hid->hidinput_open = hidinput_open; 1232 hid->hid_open = usbhid_open;
1245 hid->hidinput_close = hidinput_close; 1233 hid->hid_close = usbhid_close;
1246#ifdef CONFIG_USB_HIDDEV 1234#ifdef CONFIG_USB_HIDDEV
1247 hid->hiddev_hid_event = hiddev_hid_event; 1235 hid->hiddev_hid_event = hiddev_hid_event;
1248 hid->hiddev_report_event = hiddev_report_event; 1236 hid->hiddev_report_event = hiddev_report_event;
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 189460e7b03f..829690d8071e 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -431,8 +431,8 @@ struct hid_device { /* device report descriptor */
431 431
432 /* device-specific function pointers */ 432 /* device-specific function pointers */
433 int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int); 433 int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int);
434 int (*hidinput_open) (struct input_dev *); 434 int (*hid_open) (struct hid_device *);
435 void (*hidinput_close) (struct input_dev *); 435 void (*hid_close) (struct hid_device *);
436 436
437 /* hiddev event handler */ 437 /* hiddev event handler */
438 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, 438 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,