21
21
#include <linux/kernel.h>
22
22
#include <linux/module.h>
23
23
#include <linux/err.h>
24
- #include <linux/phy/phy .h>
24
+ #include <linux/of .h>
25
25
#include <linux/platform_device.h>
26
26
#include <linux/pm_runtime.h>
27
27
#include <linux/reset.h>
38
38
struct ohci_platform_priv {
39
39
struct clk * clks [OHCI_MAX_CLKS ];
40
40
struct reset_control * resets ;
41
- struct phy * * phys ;
42
- int num_phys ;
43
41
};
44
42
45
43
static const char hcd_name [] = "ohci-platform" ;
@@ -48,32 +46,16 @@ static int ohci_platform_power_on(struct platform_device *dev)
48
46
{
49
47
struct usb_hcd * hcd = platform_get_drvdata (dev );
50
48
struct ohci_platform_priv * priv = hcd_to_ohci_priv (hcd );
51
- int clk , ret , phy_num ;
49
+ int clk , ret ;
52
50
53
51
for (clk = 0 ; clk < OHCI_MAX_CLKS && priv -> clks [clk ]; clk ++ ) {
54
52
ret = clk_prepare_enable (priv -> clks [clk ]);
55
53
if (ret )
56
54
goto err_disable_clks ;
57
55
}
58
56
59
- for (phy_num = 0 ; phy_num < priv -> num_phys ; phy_num ++ ) {
60
- ret = phy_init (priv -> phys [phy_num ]);
61
- if (ret )
62
- goto err_exit_phy ;
63
- ret = phy_power_on (priv -> phys [phy_num ]);
64
- if (ret ) {
65
- phy_exit (priv -> phys [phy_num ]);
66
- goto err_exit_phy ;
67
- }
68
- }
69
-
70
57
return 0 ;
71
58
72
- err_exit_phy :
73
- while (-- phy_num >= 0 ) {
74
- phy_power_off (priv -> phys [phy_num ]);
75
- phy_exit (priv -> phys [phy_num ]);
76
- }
77
59
err_disable_clks :
78
60
while (-- clk >= 0 )
79
61
clk_disable_unprepare (priv -> clks [clk ]);
@@ -85,12 +67,7 @@ static void ohci_platform_power_off(struct platform_device *dev)
85
67
{
86
68
struct usb_hcd * hcd = platform_get_drvdata (dev );
87
69
struct ohci_platform_priv * priv = hcd_to_ohci_priv (hcd );
88
- int clk , phy_num ;
89
-
90
- for (phy_num = 0 ; phy_num < priv -> num_phys ; phy_num ++ ) {
91
- phy_power_off (priv -> phys [phy_num ]);
92
- phy_exit (priv -> phys [phy_num ]);
93
- }
70
+ int clk ;
94
71
95
72
for (clk = OHCI_MAX_CLKS - 1 ; clk >= 0 ; clk -- )
96
73
if (priv -> clks [clk ])
@@ -117,7 +94,7 @@ static int ohci_platform_probe(struct platform_device *dev)
117
94
struct usb_ohci_pdata * pdata = dev_get_platdata (& dev -> dev );
118
95
struct ohci_platform_priv * priv ;
119
96
struct ohci_hcd * ohci ;
120
- int err , irq , phy_num , clk = 0 ;
97
+ int err , irq , clk = 0 ;
121
98
122
99
if (usb_disabled ())
123
100
return - ENODEV ;
@@ -169,29 +146,6 @@ static int ohci_platform_probe(struct platform_device *dev)
169
146
of_property_read_u32 (dev -> dev .of_node , "num-ports" ,
170
147
& ohci -> num_ports );
171
148
172
- priv -> num_phys = of_count_phandle_with_args (dev -> dev .of_node ,
173
- "phys" , "#phy-cells" );
174
-
175
- if (priv -> num_phys > 0 ) {
176
- priv -> phys = devm_kcalloc (& dev -> dev , priv -> num_phys ,
177
- sizeof (struct phy * ), GFP_KERNEL );
178
- if (!priv -> phys )
179
- return - ENOMEM ;
180
- } else
181
- priv -> num_phys = 0 ;
182
-
183
- for (phy_num = 0 ; phy_num < priv -> num_phys ; phy_num ++ ) {
184
- priv -> phys [phy_num ] = devm_of_phy_get_by_index (
185
- & dev -> dev , dev -> dev .of_node , phy_num );
186
- if (IS_ERR (priv -> phys [phy_num ])) {
187
- err = PTR_ERR (priv -> phys [phy_num ]);
188
- goto err_put_hcd ;
189
- } else {
190
- /* Avoiding phy_get() in usb_add_hcd() */
191
- hcd -> skip_phy_initialization = 1 ;
192
- }
193
- }
194
-
195
149
for (clk = 0 ; clk < OHCI_MAX_CLKS ; clk ++ ) {
196
150
priv -> clks [clk ] = of_clk_get (dev -> dev .of_node , clk );
197
151
if (IS_ERR (priv -> clks [clk ])) {
@@ -277,7 +231,7 @@ static int ohci_platform_probe(struct platform_device *dev)
277
231
err_put_clks :
278
232
while (-- clk >= 0 )
279
233
clk_put (priv -> clks [clk ]);
280
- err_put_hcd :
234
+
281
235
if (pdata == & ohci_platform_defaults )
282
236
dev -> dev .platform_data = NULL ;
283
237
0 commit comments