Skip to content

Commit

Permalink
USB: ehci-fsl: Use usb_put_transceiver instead of put_device
Browse files Browse the repository at this point in the history
Currently usb_put_transceiver calls put_device so this is a no-op but it
is better to keep API usage consistent as ehci->transceiver is allocated
with usb_get_transceiver.

While at there remove one extra ehci->transceiver test as the code block
has already tested it.

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jarkko Nikula authored and Greg Kroah-Hartman committed May 14, 2012
1 parent bebc56d commit fee8bc1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/usb/host/ehci-fsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
retval = otg_set_host(ehci->transceiver->otg,
&ehci_to_hcd(ehci)->self);
if (retval) {
if (ehci->transceiver)
put_device(ehci->transceiver->dev);
usb_put_transceiver(ehci->transceiver);
goto err4;
}
} else {
Expand Down Expand Up @@ -195,7 +194,7 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd,

if (ehci->transceiver) {
otg_set_host(ehci->transceiver->otg, NULL);
put_device(ehci->transceiver->dev);
usb_put_transceiver(ehci->transceiver);
}

usb_remove_hcd(hcd);
Expand Down

0 comments on commit fee8bc1

Please sign in to comment.