File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ static int aw2013_blink_set(struct led_classdev *cdev,
263
263
264
264
static int aw2013_probe_dt (struct aw2013 * chip )
265
265
{
266
- struct device_node * np = dev_of_node (& chip -> client -> dev ), * child ;
266
+ struct device_node * np = dev_of_node (& chip -> client -> dev );
267
267
int count , ret = 0 , i = 0 ;
268
268
struct aw2013_led * led ;
269
269
@@ -273,7 +273,7 @@ static int aw2013_probe_dt(struct aw2013 *chip)
273
273
274
274
regmap_write (chip -> regmap , AW2013_RSTR , AW2013_RSTR_RESET );
275
275
276
- for_each_available_child_of_node (np , child ) {
276
+ for_each_available_child_of_node_scoped (np , child ) {
277
277
struct led_init_data init_data = {};
278
278
u32 source ;
279
279
u32 imax ;
@@ -304,10 +304,8 @@ static int aw2013_probe_dt(struct aw2013 *chip)
304
304
305
305
ret = devm_led_classdev_register_ext (& chip -> client -> dev ,
306
306
& led -> cdev , & init_data );
307
- if (ret < 0 ) {
308
- of_node_put (child );
307
+ if (ret < 0 )
309
308
return ret ;
310
- }
311
309
312
310
i ++ ;
313
311
}
You can’t perform that action at this time.
0 commit comments