The devm_ functions allocate memory that is released when a driver
detaches. This patch uses devm_clk_get() for these functions.

Signed-off-by: Jingoo Han <jg1....@samsung.com>
---
 drivers/usb/host/ohci-exynos.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 7bca600..1b394ed 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -115,7 +115,7 @@ static int __devinit exynos_ohci_probe(struct 
platform_device *pdev)
        }
 
        exynos_ohci->hcd = hcd;
-       exynos_ohci->clk = clk_get(&pdev->dev, "usbhost");
+       exynos_ohci->clk = devm_clk_get(&pdev->dev, "usbhost");
 
        if (IS_ERR(exynos_ohci->clk)) {
                dev_err(&pdev->dev, "Failed to get usbhost clock\n");
@@ -125,7 +125,7 @@ static int __devinit exynos_ohci_probe(struct 
platform_device *pdev)
 
        err = clk_prepare_enable(exynos_ohci->clk);
        if (err)
-               goto fail_clken;
+               goto fail_clk;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res) {
@@ -168,8 +168,6 @@ static int __devinit exynos_ohci_probe(struct 
platform_device *pdev)
 
 fail_io:
        clk_disable_unprepare(exynos_ohci->clk);
-fail_clken:
-       clk_put(exynos_ohci->clk);
 fail_clk:
        usb_put_hcd(hcd);
        return err;
@@ -187,7 +185,6 @@ static int __devexit exynos_ohci_remove(struct 
platform_device *pdev)
                pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
 
        clk_disable_unprepare(exynos_ohci->clk);
-       clk_put(exynos_ohci->clk);
 
        usb_put_hcd(hcd);
 
-- 
1.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to