diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2013-07-02 02:52:59 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-27 00:54:29 +0400 |
commit | 09ae8e7ead08e403413ceb4ba0f47eb324d03995 (patch) | |
tree | 85e0538848013d257fa3ee4df2d1a494f477fdf2 | |
parent | 8fb35f2d3189f27fe51fb485e9b9751b202d585b (diff) | |
download | linux-09ae8e7ead08e403413ceb4ba0f47eb324d03995.tar.xz |
usb: ohci-ep93xx: use devm_clk_get()
Use devm_clk_get() to make the code a bit cleaner and simpler.
This also fixes a bug where a clk_put() is not done if usb_add_hcd()
fails.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/ohci-ep93xx.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index b4f5e6403991..28fa6b8b5acd 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c @@ -69,9 +69,8 @@ static int usb_hcd_ep93xx_probe(const struct hc_driver *driver, goto err_put_hcd; } - usb_host_clock = clk_get(&pdev->dev, NULL); + usb_host_clock = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(usb_host_clock)) { - dev_dbg(&pdev->dev, "clk_get failed\n"); retval = PTR_ERR(usb_host_clock); goto err_put_hcd; } @@ -96,7 +95,6 @@ static void usb_hcd_ep93xx_remove(struct usb_hcd *hcd, { usb_remove_hcd(hcd); ep93xx_stop_hc(&pdev->dev); - clk_put(usb_host_clock); usb_put_hcd(hcd); } |