USB: straighten out port feature vs. port status usage
This patch (as1349b) clears up the confusion in many USB host controller drivers between port features and port statuses. In mosty cases it's true that the status bit is in the position given by the corresponding feature value, but that's not always true and it's not guaranteed in the USB spec. There's no functional change, just replacing expressions of the form (1 << USB_PORT_FEAT_x) with USB_PORT_STAT_x, which has the same value. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
此提交包含在:
@@ -353,8 +353,7 @@ void musb_hnp_stop(struct musb *musb)
|
||||
* which cause occasional OPT A "Did not receive reset after connect"
|
||||
* errors.
|
||||
*/
|
||||
musb->port1_status &=
|
||||
~(1 << USB_PORT_FEAT_C_CONNECTION);
|
||||
musb->port1_status &= ~(USB_PORT_STAT_C_CONNECTION << 16);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -530,8 +529,8 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
|
||||
musb_writeb(mbase, MUSB_DEVCTL, devctl);
|
||||
} else {
|
||||
musb->port1_status |=
|
||||
(1 << USB_PORT_FEAT_OVER_CURRENT)
|
||||
| (1 << USB_PORT_FEAT_C_OVER_CURRENT);
|
||||
USB_PORT_STAT_OVERCURRENT
|
||||
| (USB_PORT_STAT_C_OVERCURRENT << 16);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@@ -183,8 +183,8 @@ static void musb_port_reset(struct musb *musb, bool do_reset)
|
||||
|
||||
void musb_root_disconnect(struct musb *musb)
|
||||
{
|
||||
musb->port1_status = (1 << USB_PORT_FEAT_POWER)
|
||||
| (1 << USB_PORT_FEAT_C_CONNECTION);
|
||||
musb->port1_status = USB_PORT_STAT_POWER
|
||||
| (USB_PORT_STAT_C_CONNECTION << 16);
|
||||
|
||||
usb_hcd_poll_rh_status(musb_to_hcd(musb));
|
||||
musb->is_active = 0;
|
||||
|
新增問題並參考
封鎖使用者