Commit 0686a1fa authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Greg Kroah-Hartman

USB: ohci-omap: Use usb_put_transceiver instead of put_device

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: default avatarJarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fee8bc1c
...@@ -217,8 +217,7 @@ static int ohci_omap_init(struct usb_hcd *hcd) ...@@ -217,8 +217,7 @@ static int ohci_omap_init(struct usb_hcd *hcd)
dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n", dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n",
ohci->transceiver->label, status); ohci->transceiver->label, status);
if (status) { if (status) {
if (ohci->transceiver) usb_put_transceiver(ohci->transceiver);
put_device(ohci->transceiver->dev);
return status; return status;
} }
} else { } else {
...@@ -405,7 +404,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev) ...@@ -405,7 +404,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
if (ohci->transceiver) { if (ohci->transceiver) {
(void) otg_set_host(ohci->transceiver->otg, 0); (void) otg_set_host(ohci->transceiver->otg, 0);
put_device(ohci->transceiver->dev); usb_put_transceiver(ohci->transceiver);
} }
if (machine_is_omap_osk()) if (machine_is_omap_osk())
gpio_free(9); gpio_free(9);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment