diff options
author | Vivek Gautam <gautam.vivek@samsung.com> | 2014-05-05 01:03:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-27 17:49:35 -0400 |
commit | 54969ed6c4d0b9eb7fa68a909be231f383f0c406 (patch) | |
tree | 9057f9f9d34dd771b1d5dd9dc0e0f141b9bbcb94 /drivers/usb/host/ohci-exynos.c | |
parent | efccd24adae9821c908bbe2cdc7e632c91902ce3 (diff) |
usb: ohci-exynos: Use struct device instead of platform_device
Change to use struct device instead of struct platform_device
for some static functions.
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@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.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 9cf80cb7c051..05f00e3098fc 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c | |||
@@ -39,18 +39,18 @@ struct exynos_ohci_hcd { | |||
39 | struct usb_otg *otg; | 39 | struct usb_otg *otg; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | static void exynos_ohci_phy_enable(struct platform_device *pdev) | 42 | static void exynos_ohci_phy_enable(struct device *dev) |
43 | { | 43 | { |
44 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | 44 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
45 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); | 45 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); |
46 | 46 | ||
47 | if (exynos_ohci->phy) | 47 | if (exynos_ohci->phy) |
48 | usb_phy_init(exynos_ohci->phy); | 48 | usb_phy_init(exynos_ohci->phy); |
49 | } | 49 | } |
50 | 50 | ||
51 | static void exynos_ohci_phy_disable(struct platform_device *pdev) | 51 | static void exynos_ohci_phy_disable(struct device *dev) |
52 | { | 52 | { |
53 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | 53 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
54 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); | 54 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); |
55 | 55 | ||
56 | if (exynos_ohci->phy) | 56 | if (exynos_ohci->phy) |
@@ -139,7 +139,7 @@ skip_phy: | |||
139 | 139 | ||
140 | platform_set_drvdata(pdev, hcd); | 140 | platform_set_drvdata(pdev, hcd); |
141 | 141 | ||
142 | exynos_ohci_phy_enable(pdev); | 142 | exynos_ohci_phy_enable(&pdev->dev); |
143 | 143 | ||
144 | err = usb_add_hcd(hcd, irq, IRQF_SHARED); | 144 | err = usb_add_hcd(hcd, irq, IRQF_SHARED); |
145 | if (err) { | 145 | if (err) { |
@@ -150,7 +150,7 @@ skip_phy: | |||
150 | return 0; | 150 | return 0; |
151 | 151 | ||
152 | fail_add_hcd: | 152 | fail_add_hcd: |
153 | exynos_ohci_phy_disable(pdev); | 153 | exynos_ohci_phy_disable(&pdev->dev); |
154 | fail_io: | 154 | fail_io: |
155 | clk_disable_unprepare(exynos_ohci->clk); | 155 | clk_disable_unprepare(exynos_ohci->clk); |
156 | fail_clk: | 156 | fail_clk: |
@@ -168,7 +168,7 @@ static int exynos_ohci_remove(struct platform_device *pdev) | |||
168 | if (exynos_ohci->otg) | 168 | if (exynos_ohci->otg) |
169 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); | 169 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); |
170 | 170 | ||
171 | exynos_ohci_phy_disable(pdev); | 171 | exynos_ohci_phy_disable(&pdev->dev); |
172 | 172 | ||
173 | clk_disable_unprepare(exynos_ohci->clk); | 173 | clk_disable_unprepare(exynos_ohci->clk); |
174 | 174 | ||
@@ -190,7 +190,6 @@ static int exynos_ohci_suspend(struct device *dev) | |||
190 | { | 190 | { |
191 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 191 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
192 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); | 192 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); |
193 | struct platform_device *pdev = to_platform_device(dev); | ||
194 | bool do_wakeup = device_may_wakeup(dev); | 193 | bool do_wakeup = device_may_wakeup(dev); |
195 | int rc = ohci_suspend(hcd, do_wakeup); | 194 | int rc = ohci_suspend(hcd, do_wakeup); |
196 | 195 | ||
@@ -200,7 +199,7 @@ static int exynos_ohci_suspend(struct device *dev) | |||
200 | if (exynos_ohci->otg) | 199 | if (exynos_ohci->otg) |
201 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); | 200 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); |
202 | 201 | ||
203 | exynos_ohci_phy_disable(pdev); | 202 | exynos_ohci_phy_disable(dev); |
204 | 203 | ||
205 | clk_disable_unprepare(exynos_ohci->clk); | 204 | clk_disable_unprepare(exynos_ohci->clk); |
206 | 205 | ||
@@ -211,14 +210,13 @@ static int exynos_ohci_resume(struct device *dev) | |||
211 | { | 210 | { |
212 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 211 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
213 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); | 212 | struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); |
214 | struct platform_device *pdev = to_platform_device(dev); | ||
215 | 213 | ||
216 | clk_prepare_enable(exynos_ohci->clk); | 214 | clk_prepare_enable(exynos_ohci->clk); |
217 | 215 | ||
218 | if (exynos_ohci->otg) | 216 | if (exynos_ohci->otg) |
219 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); | 217 | exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); |
220 | 218 | ||
221 | exynos_ohci_phy_enable(pdev); | 219 | exynos_ohci_phy_enable(dev); |
222 | 220 | ||
223 | ohci_resume(hcd, false); | 221 | ohci_resume(hcd, false); |
224 | 222 | ||