提交 9f20dfb4 编写于 作者: Y Yuyang Du 提交者: Felipe Balbi

usb: gadget: dummy_hcd: Fix wrong power status bit clear/reset in dummy_hub_control()

This fixes the commit: 1cd8fd28 ("usb: gadget: dummy_hcd: add
SuperSpeed support").

In the case of ClearPortFeature and USB_PORT_FEAT_POWER, simply clear
the right bit regardless of what the wValue is.
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NYuyang Du <yuyang.du@intel.com>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 a2cfed43
...@@ -2062,16 +2062,13 @@ static int dummy_hub_control( ...@@ -2062,16 +2062,13 @@ static int dummy_hub_control(
} }
break; break;
case USB_PORT_FEAT_POWER: case USB_PORT_FEAT_POWER:
if (hcd->speed == HCD_USB3) { dev_dbg(dummy_dev(dum_hcd), "power-off\n");
if (dum_hcd->port_status & USB_PORT_STAT_POWER) if (hcd->speed == HCD_USB3)
dev_dbg(dummy_dev(dum_hcd), dum_hcd->port_status &= ~USB_SS_PORT_STAT_POWER;
"power-off\n"); else
} else dum_hcd->port_status &= ~USB_PORT_STAT_POWER;
if (dum_hcd->port_status & set_link_state(dum_hcd);
USB_SS_PORT_STAT_POWER) break;
dev_dbg(dummy_dev(dum_hcd),
"power-off\n");
/* FALLS THROUGH */
default: default:
dum_hcd->port_status &= ~(1 << wValue); dum_hcd->port_status &= ~(1 << wValue);
set_link_state(dum_hcd); set_link_state(dum_hcd);
...@@ -2242,14 +2239,13 @@ static int dummy_hub_control( ...@@ -2242,14 +2239,13 @@ static int dummy_hub_control(
if ((dum_hcd->port_status & if ((dum_hcd->port_status &
USB_SS_PORT_STAT_POWER) != 0) { USB_SS_PORT_STAT_POWER) != 0) {
dum_hcd->port_status |= (1 << wValue); dum_hcd->port_status |= (1 << wValue);
set_link_state(dum_hcd);
} }
} else } else
if ((dum_hcd->port_status & if ((dum_hcd->port_status &
USB_PORT_STAT_POWER) != 0) { USB_PORT_STAT_POWER) != 0) {
dum_hcd->port_status |= (1 << wValue); dum_hcd->port_status |= (1 << wValue);
set_link_state(dum_hcd);
} }
set_link_state(dum_hcd);
} }
break; break;
case GetPortErrorCount: case GetPortErrorCount:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册