Re: [PATCH] USB: cleanup the handling of the PM complete call

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

 



On Tue, 10 Jan 2012, Oliver Neukum wrote:

> From d42495835b1795e333c28ecad82b702591f500ea Mon Sep 17 00:00:00 2001
> From: Oliver Neukum <oliver@xxxxxxxxxx>
> Date: Tue, 10 Jan 2012 13:52:39 +0100
> Subject: [PATCH] USB: cleanup the handling of the PM complete call
> 
> This eliminates the last instance of a function's behavior
> controlled by a parameter as Linus hates such things.

Good but...

> --- a/drivers/usb/core/driver.c
> +++ b/drivers/usb/core/driver.c
> @@ -1329,35 +1329,39 @@ int usb_suspend(struct device *dev, pm_message_t msg)
>  	return usb_suspend_both(udev, msg);
>  }
>  

Please copy here the comment about the PM core holding the device lock.

> +int usb_resume_complete(struct device *dev)
> +{
> +	struct usb_device *udev = to_usb_device(dev);
> +
> +	/* For PM complete calls, all we do is rebind interfaces
> +	 * whose needs_binding flag is set
> +	 */
> +	if (udev->state != USB_STATE_NOTATTACHED)
> +		do_rebind_interfaces(udev);
> +	return 0;
> +}
> +
>  /* The device lock is held by the PM core */
>  int usb_resume(struct device *dev, pm_message_t msg)
>  {
>  	struct usb_device	*udev = to_usb_device(dev);
>  	int			status;
>  
> -	/* For PM complete calls, all we do is rebind interfaces
> -	 * whose needs_binding flag is set
> -	 */
> -	if (msg.event == PM_EVENT_ON) {
> -		if (udev->state != USB_STATE_NOTATTACHED)
> -			do_rebind_interfaces(udev);
> -		status = 0;
>  
> -	/* For all other calls, take the device back to full power and
> +
> +	/* For all calls, take the device back to full power and
>  	 * tell the PM core in case it was autosuspended previously.
>  	 * Unbind the interfaces that will need rebinding later,
>  	 * because they fail to support reset_resume.
>  	 * (This can't be done in usb_resume_interface()
>           * above because it doesn't own the right set of locks.)

What happened on this line?  Spaces inserted instead of a tab?

Apart from these two things:

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

Alan Stern

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