Skip to contentSkip to conversation

input: aiptek: use HID headers

PATCH Applied Oliver Neukum 2 participants 4 messages Mar 25

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/input/tablet/aiptek.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/input/tablet/aiptek.c +3 -4
index 6df24cee3c9d..1ad3c19aa155 100644
@@ -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
#1 lore raw

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.

---
 drivers/input/tablet/pegasus_notetaker.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/input/tablet/pegasus_notetaker.c +2 -5
index 3a8493ed5e44..6415bfe1886e 100644
@@ -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
maintainer Applied
#2 lore raw

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.

Applied, thank you.

Signature · 1 line
Dmitry