ehci-hub: use HUB_CHAR_*
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sun, 18 Jan 2015 22:25:44 +0000 (01:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Jan 2015 13:01:11 +0000 (21:01 +0800)
Fix  using the  bare numbers to set the 'wHubCharacteristics' field of the Hub
Descriptor while the values are #define'd in <linux/usb/ch11.h>.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-hub.c

index 118edb7bdca288f2f2adf9f7783f3b54949e870d..87cf86f38b363ff0f81dd66367769ff594d266bc 100644 (file)
@@ -700,15 +700,15 @@ ehci_hub_descriptor (
        memset(&desc->u.hs.DeviceRemovable[0], 0, temp);
        memset(&desc->u.hs.DeviceRemovable[temp], 0xff, temp);
 
-       temp = 0x0008;                  /* per-port overcurrent reporting */
+       temp = HUB_CHAR_INDV_PORT_OCPM; /* per-port overcurrent reporting */
        if (HCS_PPC (ehci->hcs_params))
-               temp |= 0x0001;         /* per-port power control */
+               temp |= HUB_CHAR_INDV_PORT_LPSM; /* per-port power control */
        else
-               temp |= 0x0002;         /* no power switching */
+               temp |= HUB_CHAR_NO_LPSM; /* no power switching */
 #if 0
 // re-enable when we support USB_PORT_FEAT_INDICATOR below.
        if (HCS_INDICATOR (ehci->hcs_params))
-               temp |= 0x0080;         /* per-port indicators (LEDs) */
+               temp |= HUB_CHAR_PORTIND; /* per-port indicators (LEDs) */
 #endif
        desc->wHubCharacteristics = cpu_to_le16(temp);
 }