File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,6 @@ static int hisi_inno_phy_probe(struct platform_device *pdev)
138
138
struct device_node * np = dev -> of_node ;
139
139
struct hisi_inno_phy_priv * priv ;
140
140
struct phy_provider * provider ;
141
- struct device_node * child ;
142
141
int i = 0 ;
143
142
int ret ;
144
143
@@ -162,32 +161,27 @@ static int hisi_inno_phy_probe(struct platform_device *pdev)
162
161
163
162
priv -> type = (uintptr_t ) of_device_get_match_data (dev );
164
163
165
- for_each_child_of_node (np , child ) {
164
+ for_each_child_of_node_scoped (np , child ) {
166
165
struct reset_control * rst ;
167
166
struct phy * phy ;
168
167
169
168
rst = of_reset_control_get_exclusive (child , NULL );
170
- if (IS_ERR (rst )) {
171
- of_node_put (child );
169
+ if (IS_ERR (rst ))
172
170
return PTR_ERR (rst );
173
- }
174
171
175
172
priv -> ports [i ].utmi_rst = rst ;
176
173
priv -> ports [i ].priv = priv ;
177
174
178
175
phy = devm_phy_create (dev , child , & hisi_inno_phy_ops );
179
- if (IS_ERR (phy )) {
180
- of_node_put (child );
176
+ if (IS_ERR (phy ))
181
177
return PTR_ERR (phy );
182
- }
183
178
184
179
phy_set_bus_width (phy , 8 );
185
180
phy_set_drvdata (phy , & priv -> ports [i ]);
186
181
i ++ ;
187
182
188
183
if (i >= INNO_PHY_PORT_NUM ) {
189
184
dev_warn (dev , "Support %d ports in maximum\n" , i );
190
- of_node_put (child );
191
185
break ;
192
186
}
193
187
}
You can’t perform that action at this time.
0 commit comments