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>
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;
}
{
usb_remove_hcd(hcd);
ep93xx_stop_hc(&pdev->dev);
- clk_put(usb_host_clock);
usb_put_hcd(hcd);
}