Re: [PATCH v9 13/19] usb: refactor port handling in hub_events()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 7 May 2014, Dan Williams wrote:

> 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
> 
> Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>

> ---
>  drivers/usb/core/hub.c |  374 ++++++++++++++++++++++++------------------------
>  1 files changed, 185 insertions(+), 189 deletions(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 4bc44b0c0b38..099077515156 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -4414,66 +4414,15 @@ hub_power_remaining (struct usb_hub *hub)
>  	return remaining;
>  }
>  
> -/* Handle physical or logical connection change events.
> - * This routine is called when:
> - * 	a port connection-change occurs;
> - *	a port enable-change occurs (often caused by EMI);
> - *	usb_reset_and_verify_device() encounters changed descriptors (as from
> - *		a firmware download)
> - * caller already locked the hub
> - */
> -static void hub_port_connect_change(struct usb_hub *hub, int port1,
> -					u16 portstatus, u16 portchange)
> +static void hub_port_reconnect(struct usb_hub *hub, int port1, u16 portstatus,
> +		u16 portchange)

There's nothing _re_connecting here; it's just an ordinary connection.  
The name should be "hub_port_connect".  Or if you insist, 
"hub_port_new_connection".

Aside from that:

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux