aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-exynos.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2012-10-04 03:11:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-24 17:39:52 -0400
commit60d80adbac9b7492439b1d0665353bc2117b4d78 (patch)
treeea7d76b9594998e0745525b8ca6a616ebeaba8e6 /drivers/usb/host/ohci-exynos.c
parentc05c946c68e381074dde259d8ce243da1b1aae02 (diff)
USB: ohci-exynos: use devm_clk_get()
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.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ohci-exynos.c')
-rw-r--r--drivers/usb/host/ohci-exynos.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 9e3d2da7537..2f303295b42 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)
115 } 115 }
116 116
117 exynos_ohci->hcd = hcd; 117 exynos_ohci->hcd = hcd;
118 exynos_ohci->clk = clk_get(&pdev->dev, "usbhost"); 118 exynos_ohci->clk = devm_clk_get(&pdev->dev, "usbhost");
119 119
120 if (IS_ERR(exynos_ohci->clk)) { 120 if (IS_ERR(exynos_ohci->clk)) {
121 dev_err(&pdev->dev, "Failed to get usbhost clock\n"); 121 dev_err(&pdev->dev, "Failed to get usbhost clock\n");
@@ -125,7 +125,7 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev)
125 125
126 err = clk_prepare_enable(exynos_ohci->clk); 126 err = clk_prepare_enable(exynos_ohci->clk);
127 if (err) 127 if (err)
128 goto fail_clken; 128 goto fail_clk;
129 129
130 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 130 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
131 if (!res) { 131 if (!res) {
@@ -168,8 +168,6 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev)
168 168
169fail_io: 169fail_io:
170 clk_disable_unprepare(exynos_ohci->clk); 170 clk_disable_unprepare(exynos_ohci->clk);
171fail_clken:
172 clk_put(exynos_ohci->clk);
173fail_clk: 171fail_clk:
174 usb_put_hcd(hcd); 172 usb_put_hcd(hcd);
175 return err; 173 return err;
@@ -187,7 +185,6 @@ static int __devexit exynos_ohci_remove(struct platform_device *pdev)
187 pdata->phy_exit(pdev, S5P_USB_PHY_HOST); 185 pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
188 186
189 clk_disable_unprepare(exynos_ohci->clk); 187 clk_disable_unprepare(exynos_ohci->clk);
190 clk_put(exynos_ohci->clk);
191 188
192 usb_put_hcd(hcd); 189 usb_put_hcd(hcd);
193 190