]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
usb: refactor port handling in hub_events()
authorDan Williams <dan.j.williams@intel.com>
Wed, 21 May 2014 01:09:15 +0000 (18:09 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 May 2014 23:51:50 +0000 (16:51 -0700)
commitaf376a461cf075de6358255579c8d42bb1246e18
treeb1f6e07252726796e18689c44ac11cd6096fc4c0
parent6908058469e3253637894d1cb3e2581870c77e1d
usb: refactor port handling in hub_events()

In preparation for synchronizing port handling with pm_runtime
transitions refactor port handling into its own subroutine.

We expect that clearing some status flags will be required regardless of
the port state, so handle those first and group all non-trivial actions
at the bottom of the routine.

This also splits off the bottom half of hub_port_connect_change() into
hub_port_reconnect() in prepartion for introducing a port->status_lock.
hub_port_reconnect() will expect the port lock to not be held while
hub_port_connect_change() expects to enter with it held.

Other cleanups include:
1/ reflowing to 80 columns
2/ replacing redundant usages of 'hub->hdev' with 'hdev'
3/ consolidate clearing of ->change_bits() in hub_port_connect_change
4/ consolidate calls to usb_reset_device

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c