Re: [PATCH] USB: ohci-omap: Use usb_put_transceiver instead of put_device

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

 



Hi,

On Sun, May 13, 2012 at 09:10:43PM +0300, Jarkko Nikula wrote:
> Currently usb_put_transceiver calls put_device so this is a no-op but it
> is better to keep API usage consistent as ohci->transceiver is allocated
> with usb_get_transceiver.
> 
> While at there remove one extra ohci->transceiver test as the code block
> has already tested it.
> 
> Signed-off-by: Jarkko Nikula <jarkko.nikula@xxxxxxxxxx>

makes sense to me:

Acked-by: Felipe Balbi <balbi@xxxxxx>

> ---
> I don't have this HW so compile tested only. Made on top of linux.git
> commit bcc62f.
> ---
>  drivers/usb/host/ohci-omap.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
> index 96451e4..74b5320 100644
> --- a/drivers/usb/host/ohci-omap.c
> +++ b/drivers/usb/host/ohci-omap.c
> @@ -217,8 +217,7 @@ static int ohci_omap_init(struct usb_hcd *hcd)
>  			dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n",
>  					ohci->transceiver->label, status);
>  			if (status) {
> -				if (ohci->transceiver)
> -					put_device(ohci->transceiver->dev);
> +				usb_put_transceiver(ohci->transceiver);
>  				return status;
>  			}
>  		} else {
> @@ -405,7 +404,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
>  	usb_remove_hcd(hcd);
>  	if (ohci->transceiver) {
>  		(void) otg_set_host(ohci->transceiver->otg, 0);
> -		put_device(ohci->transceiver->dev);
> +		usb_put_transceiver(ohci->transceiver);
>  	}
>  	if (machine_is_omap_osk())
>  		gpio_free(9);
> -- 
> 1.7.10
> 

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux