Re: [PATCH 5/6] usb/dummy_hcd: move common bits of suspend/resume into one function

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

 



On Thu, 16 Jun 2011, Sebastian Andrzej Siewior wrote:

> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> ---
>  drivers/usb/gadget/dummy_hcd.c |   26 ++++++++++----------------
>  1 files changed, 10 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
> index 865faf0..0bdc035 100644
> --- a/drivers/usb/gadget/dummy_hcd.c
> +++ b/drivers/usb/gadget/dummy_hcd.c
> @@ -1040,36 +1040,30 @@ static int dummy_udc_remove (struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int dummy_udc_suspend (struct platform_device *pdev, pm_message_t state)
> +static int dummy_udc_pm(struct platform_device *pdev, int suspend)
>  {
>  	struct dummy	*dum = platform_get_drvdata(pdev);
>  	struct dummy_hcd *dum_hcd;
>  
> -	dev_dbg (&pdev->dev, "%s\n", __func__);
>  	dum_hcd = gadget_to_dummy_hcd(&dum->gadget);
>  	spin_lock_irq (&dum->lock);
> -	dum->udc_suspended = 1;
> +	dum->udc_suspended = suspend;
>  	set_link_state(dum_hcd);
>  	spin_unlock_irq (&dum->lock);
> -
>  	usb_hcd_poll_rh_status(dummy_hcd_to_hcd(dum_hcd));

This last line belongs in dummy_udc_suspend(), not dummy_udc_pm().

>  	return 0;
>  }

Why declare a return value if you're always going to return 0?

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