Skip to contentSkip to conversation

usb: ohci-ep93xx: use devm_clk_get()

PATCH In review H Hartley Sweeten 1 participant 1 message Jul 1, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 3/4 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.

Cc Lennert Buytenhek <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/usb/host/ohci-ep93xx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/usb/host/ohci-ep93xx.c +1 -3
index b4f5e64..28fa6b8 100644
@@ -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);
 }
 
Signature · 1 line
1.8.1.4