Skip to content

Commit 1e041b6

Browse files
mszyprowFelipe Balbi
authored andcommitted
usb: dwc3: exynos: Remove dead code
All supported Exynos variants provide respective generic PHY framework based drivers for controlling USB PHYs, so there is no point creating fake USB PHYs based on platform devices. While removing useless code, remove calls to runtime PM, which have no effect. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
1 parent 4a13b96 commit 1e041b6

File tree

1 file changed

+0
-75
lines changed

1 file changed

+0
-75
lines changed

drivers/usb/dwc3/dwc3-exynos.c

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@
1313
#include <linux/slab.h>
1414
#include <linux/platform_device.h>
1515
#include <linux/clk.h>
16-
#include <linux/usb/otg.h>
17-
#include <linux/usb/usb_phy_generic.h>
1816
#include <linux/of.h>
1917
#include <linux/of_platform.h>
2018
#include <linux/regulator/consumer.h>
2119

2220
struct dwc3_exynos {
23-
struct platform_device *usb2_phy;
24-
struct platform_device *usb3_phy;
2521
struct device *dev;
2622

2723
struct clk *clk;
@@ -32,61 +28,6 @@ struct dwc3_exynos {
3228
struct regulator *vdd10;
3329
};
3430

35-
static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos)
36-
{
37-
struct usb_phy_generic_platform_data pdata;
38-
struct platform_device *pdev;
39-
int ret;
40-
41-
memset(&pdata, 0x00, sizeof(pdata));
42-
43-
pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO);
44-
if (!pdev)
45-
return -ENOMEM;
46-
47-
exynos->usb2_phy = pdev;
48-
pdata.type = USB_PHY_TYPE_USB2;
49-
pdata.gpio_reset = -1;
50-
51-
ret = platform_device_add_data(exynos->usb2_phy, &pdata, sizeof(pdata));
52-
if (ret)
53-
goto err1;
54-
55-
pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO);
56-
if (!pdev) {
57-
ret = -ENOMEM;
58-
goto err1;
59-
}
60-
61-
exynos->usb3_phy = pdev;
62-
pdata.type = USB_PHY_TYPE_USB3;
63-
64-
ret = platform_device_add_data(exynos->usb3_phy, &pdata, sizeof(pdata));
65-
if (ret)
66-
goto err2;
67-
68-
ret = platform_device_add(exynos->usb2_phy);
69-
if (ret)
70-
goto err2;
71-
72-
ret = platform_device_add(exynos->usb3_phy);
73-
if (ret)
74-
goto err3;
75-
76-
return 0;
77-
78-
err3:
79-
platform_device_del(exynos->usb2_phy);
80-
81-
err2:
82-
platform_device_put(exynos->usb3_phy);
83-
84-
err1:
85-
platform_device_put(exynos->usb2_phy);
86-
87-
return ret;
88-
}
89-
9031
static int dwc3_exynos_remove_child(struct device *dev, void *unused)
9132
{
9233
struct platform_device *pdev = to_platform_device(dev);
@@ -164,12 +105,6 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
164105
goto vdd10_err;
165106
}
166107

167-
ret = dwc3_exynos_register_phys(exynos);
168-
if (ret) {
169-
dev_err(dev, "couldn't register PHYs\n");
170-
goto phys_err;
171-
}
172-
173108
if (node) {
174109
ret = of_platform_populate(node, NULL, NULL, dev);
175110
if (ret) {
@@ -185,9 +120,6 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
185120
return 0;
186121

187122
populate_err:
188-
platform_device_unregister(exynos->usb2_phy);
189-
platform_device_unregister(exynos->usb3_phy);
190-
phys_err:
191123
regulator_disable(exynos->vdd10);
192124
vdd10_err:
193125
regulator_disable(exynos->vdd33);
@@ -205,8 +137,6 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
205137
struct dwc3_exynos *exynos = platform_get_drvdata(pdev);
206138

207139
device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child);
208-
platform_device_unregister(exynos->usb2_phy);
209-
platform_device_unregister(exynos->usb3_phy);
210140

211141
clk_disable_unprepare(exynos->axius_clk);
212142
clk_disable_unprepare(exynos->susp_clk);
@@ -258,11 +188,6 @@ static int dwc3_exynos_resume(struct device *dev)
258188
clk_enable(exynos->clk);
259189
clk_enable(exynos->axius_clk);
260190

261-
/* runtime set active to reflect active state. */
262-
pm_runtime_disable(dev);
263-
pm_runtime_set_active(dev);
264-
pm_runtime_enable(dev);
265-
266191
return 0;
267192
}
268193

0 commit comments

Comments
 (0)