* [PATCH 1/2] usb: misc: appledisplay: use HID includes
@ 2026-03-25 17:12 Oliver Neukum
2026-03-25 17:12 ` [PATCH 2/2] usb: misc: iowarrior: " Oliver Neukum
0 siblings, 1 reply; 2+ messages in thread
From: Oliver Neukum @ 2026-03-25 17:12 UTC (permalink / raw)
To: gregkh, linux-usb; +Cc: 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 <oneukum@suse.com>
---
drivers/usb/misc/appledisplay.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
index 4beebde59842..16883592f7fc 100644
--- a/drivers/usb/misc/appledisplay.c
+++ b/drivers/usb/misc/appledisplay.c
@@ -12,6 +12,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
+#include <linux/hid.h>
#include <linux/usb.h>
#include <linux/backlight.h>
#include <linux/timer.h>
@@ -20,9 +21,6 @@
#define APPLE_VENDOR_ID 0x05AC
-#define USB_REQ_GET_REPORT 0x01
-#define USB_REQ_SET_REPORT 0x09
-
#define ACD_USB_TIMEOUT 250
#define ACD_USB_EDID 0x0302
@@ -140,7 +138,7 @@ static int appledisplay_bl_update_status(struct backlight_device *bd)
retval = usb_control_msg(
pdata->udev,
usb_sndctrlpipe(pdata->udev, 0),
- USB_REQ_SET_REPORT,
+ HID_REQ_SET_REPORT,
USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
ACD_USB_BRIGHTNESS,
0,
@@ -163,7 +161,7 @@ static int appledisplay_bl_get_brightness(struct backlight_device *bd)
retval = usb_control_msg(
pdata->udev,
usb_rcvctrlpipe(pdata->udev, 0),
- USB_REQ_GET_REPORT,
+ HID_REQ_GET_REPORT,
USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
ACD_USB_BRIGHTNESS,
0,
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] usb: misc: iowarrior: use HID includes
2026-03-25 17:12 [PATCH 1/2] usb: misc: appledisplay: use HID includes Oliver Neukum
@ 2026-03-25 17:12 ` Oliver Neukum
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Neukum @ 2026-03-25 17:12 UTC (permalink / raw)
To: gregkh, linux-usb; +Cc: 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 <oneukum@suse.com>
---
drivers/usb/misc/iowarrior.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 54f1bb0f7123..22504c0a2841 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -21,6 +21,7 @@
#include <linux/sched.h>
#include <linux/mutex.h>
#include <linux/poll.h>
+#include <linux/hid.h>
#include <linux/usb/iowarrior.h>
#define DRIVER_AUTHOR "Christian Lucht <lucht@codemercs.com>"
@@ -98,14 +99,13 @@ struct iowarrior {
/* globals */
/*--------------*/
-#define USB_REQ_GET_REPORT 0x01
//#if 0
static int usb_get_report(struct usb_device *dev,
struct usb_host_interface *inter, unsigned char type,
unsigned char id, void *buf, int size)
{
return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
- USB_REQ_GET_REPORT,
+ HID_REQ_GET_REPORT,
USB_DIR_IN | USB_TYPE_CLASS |
USB_RECIP_INTERFACE, (type << 8) + id,
inter->desc.bInterfaceNumber, buf, size,
@@ -113,14 +113,12 @@ static int usb_get_report(struct usb_device *dev,
}
//#endif
-#define USB_REQ_SET_REPORT 0x09
-
static int usb_set_report(struct usb_interface *intf, unsigned char type,
unsigned char id, void *buf, int size)
{
return usb_control_msg(interface_to_usbdev(intf),
usb_sndctrlpipe(interface_to_usbdev(intf), 0),
- USB_REQ_SET_REPORT,
+ HID_REQ_SET_REPORT,
USB_TYPE_CLASS | USB_RECIP_INTERFACE,
(type << 8) + id,
intf->cur_altsetting->desc.bInterfaceNumber, buf,
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-25 17:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-25 17:12 [PATCH 1/2] usb: misc: appledisplay: use HID includes Oliver Neukum
2026-03-25 17:12 ` [PATCH 2/2] usb: misc: iowarrior: " Oliver Neukum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox