aboutsummaryrefslogtreecommitdiff
path: root/common/usb_kbd.c
diff options
context:
space:
mode:
authorSimon Glass2015-11-08 23:48:04 -0700
committerSimon Glass2015-11-19 20:27:52 -0700
commit2cdb58ebdc3268a261cd3761b730ca4b98d37985 (patch)
tree66c39d1586858258b51fffe793f2408ec9352199 /common/usb_kbd.c
parent17627609e0b5d2222233c852d316276d67695c6e (diff)
usb: Avoid open-coded USB constants in usb_kbd.c
Replace the open-coded values with constants to make it clearer what they mean. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/usb_kbd.c')
-rw-r--r--common/usb_kbd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 1d85212af92..069fbd2de7d 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -411,13 +411,13 @@ static int usb_kbd_probe_dev(struct usb_device *dev, unsigned int ifnum)
iface = &dev->config.if_desc[ifnum];
- if (iface->desc.bInterfaceClass != 3)
+ if (iface->desc.bInterfaceClass != USB_CLASS_HID)
return 0;
- if (iface->desc.bInterfaceSubClass != 1)
+ if (iface->desc.bInterfaceSubClass != USB_SUB_HID_BOOT)
return 0;
- if (iface->desc.bInterfaceProtocol != 1)
+ if (iface->desc.bInterfaceProtocol != USB_PROT_HID_KEYBOARD)
return 0;
if (iface->desc.bNumEndpoints != 1)
@@ -626,8 +626,8 @@ static const struct usb_device_id kbd_id_table[] = {
USB_DEVICE_ID_MATCH_INT_SUBCLASS |
USB_DEVICE_ID_MATCH_INT_PROTOCOL,
.bInterfaceClass = USB_CLASS_HID,
- .bInterfaceSubClass = 1,
- .bInterfaceProtocol = 1,
+ .bInterfaceSubClass = USB_SUB_HID_BOOT,
+ .bInterfaceProtocol = USB_PROT_HID_KEYBOARD,
},
{ } /* Terminating entry */
};