input: aiptek: use HID headers
Subsystems (2)
PATCH 1/2 input: aiptek: use HID headers
The driver uses its own definitions for HID requests. This leads to duplication and obfuscation. Use HID's definitions.
Signed-off-by Oliver Neukum <[email protected]>
--- drivers/input/tablet/aiptek.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/input/tablet/aiptek.c +3 -4
@@ -57,6 +57,7 @@* http://aiptektablet.sourceforge.net. */ +#include <linux/hid.h> #include <linux/jiffies.h> #include <linux/kernel.h> #include <linux/slab.h>
@@ -164,8 +165,6 @@#define USB_VENDOR_ID_AIPTEK 0x08ca#define USB_VENDOR_ID_KYE 0x0458 -#define USB_REQ_GET_REPORT 0x01 -#define USB_REQ_SET_REPORT 0x09/* PointerMode codes */
@@ -856,7 +855,7 @@ aiptek_set_report(struct aiptek *aiptek,return usb_control_msg (udev,usb_sndctrlpipe (udev,0 ), -USB_REQ_SET_REPORT , +HID_REQ_SET_REPORT ,USB_TYPE_CLASS |USB_RECIP_INTERFACE |USB_DIR_OUT , (report_type <<8 ) + report_id, aiptek->ifnum, buffer, size,5000 );
@@ -871,7 +870,7 @@ aiptek_get_report(struct aiptek *aiptek,return usb_control_msg (udev,usb_rcvctrlpipe (udev,0 ), -USB_REQ_GET_REPORT , +HID_REQ_GET_REPORT ,USB_TYPE_CLASS |USB_RECIP_INTERFACE |USB_DIR_IN , (report_type <<8 ) + report_id, aiptek->ifnum, buffer, size,5000 );
Signature · 1 line
2.53.0
PATCH 2/2 input: pegasus_notetaker: use HID defines
The driver uses its own definitions for HID requests. This leads to duplication and obfuscation. Use HID's definitions.
Signed-off-by Oliver Neukum <[email protected]>
--- drivers/input/tablet/pegasus_notetaker.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/input/tablet/pegasus_notetaker.c +2 -5
@@ -36,6 +36,7 @@* T Tip */ +#include <linux/hid.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/input.h>
@@ -44,10 +45,6 @@#include <linux/workqueue.h> #include <linux/mutex.h> -/* USB HID defines */ -#define USB_REQ_GET_REPORT 0x01 -#define USB_REQ_SET_REPORT 0x09 -#define USB_VENDOR_ID_PEGASUSTECH 0x0e20#define USB_DEVICE_ID_PEGASUS_NOTETAKER_EN100 0x0101
@@ -108,7 +105,7 @@ static int pegasus_control_msg(struct pegasus *pegasus, u8 *data, int len) result =usb_control_msg (pegasus->usbdev,usb_sndctrlpipe (pegasus->usbdev,0 ), -USB_REQ_SET_REPORT , +HID_REQ_SET_REPORT ,USB_TYPE_VENDOR |USB_DIR_OUT ,0 ,0 , cmd_buf, sizeof_buf,USB_CTRL_SET_TIMEOUT );
Signature · 1 line
2.53.0
Re: [PATCH 2/2] input: pegasus_notetaker: use HID defines
Quoted 5 lines · Oliver Neukum
The driver uses its own definitions for HID requests. This leads to duplication and obfuscation. Use HID's definitions.
Signed-off-by Oliver Neukum <[email protected]>
Applied, thank you.
Signature · 1 line
Dmitry
Quoted 5 lines · Oliver Neukum
The driver uses its own definitions for HID requests. This leads to duplication and obfuscation. Use HID's definitions.
Signed-off-by Oliver Neukum <[email protected]>
Applied, thank you.
Signature · 1 line
Dmitry