Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09ae8e7e authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8fb35f2d
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -69,9 +69,8 @@ static int usb_hcd_ep93xx_probe(const struct hc_driver *driver,
		goto err_put_hcd;
		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)) {
	if (IS_ERR(usb_host_clock)) {
		dev_dbg(&pdev->dev, "clk_get failed\n");
		retval = PTR_ERR(usb_host_clock);
		retval = PTR_ERR(usb_host_clock);
		goto err_put_hcd;
		goto err_put_hcd;
	}
	}
@@ -96,7 +95,6 @@ static void usb_hcd_ep93xx_remove(struct usb_hcd *hcd,
{
{
	usb_remove_hcd(hcd);
	usb_remove_hcd(hcd);
	ep93xx_stop_hc(&pdev->dev);
	ep93xx_stop_hc(&pdev->dev);
	clk_put(usb_host_clock);
	usb_put_hcd(hcd);
	usb_put_hcd(hcd);
}
}