Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db42a4c9 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Greg Kroah-Hartman
Browse files

ohci-hub: use HUB_CHAR_*



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>.

While at it, fix the indentation.

Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a9c49bcd
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -544,15 +544,15 @@ ohci_hub_descriptor (
	temp = 1 + (ohci->num_ports / 8);
	temp = 1 + (ohci->num_ports / 8);
	desc->bDescLength = 7 + 2 * temp;
	desc->bDescLength = 7 + 2 * temp;


	temp = 0;
	temp = HUB_CHAR_COMMON_LPSM | HUB_CHAR_COMMON_OCPM;
	if (rh & RH_A_NPS)		/* no power switching? */
	if (rh & RH_A_NPS)		/* no power switching? */
	    temp |= 0x0002;
		temp |= HUB_CHAR_NO_LPSM;
	if (rh & RH_A_PSM)		/* per-port power switching? */
	if (rh & RH_A_PSM)		/* per-port power switching? */
	    temp |= 0x0001;
		temp |= HUB_CHAR_INDV_PORT_LPSM;
	if (rh & RH_A_NOCP)		/* no overcurrent reporting? */
	if (rh & RH_A_NOCP)		/* no overcurrent reporting? */
	    temp |= 0x0010;
		temp |= HUB_CHAR_NO_OCPM;
	else if (rh & RH_A_OCPM)	/* per-port overcurrent reporting? */
	else if (rh & RH_A_OCPM)	/* per-port overcurrent reporting? */
	    temp |= 0x0008;
		temp |= HUB_CHAR_INDV_PORT_OCPM;
	desc->wHubCharacteristics = cpu_to_le16(temp);
	desc->wHubCharacteristics = cpu_to_le16(temp);


	/* ports removable, and usb 1.0 legacy PortPwrCtrlMask */
	/* ports removable, and usb 1.0 legacy PortPwrCtrlMask */