File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ static int pl353_smc_probe(struct amba_device *adev, const struct amba_id *id)
74
74
struct device_node * of_node = adev -> dev .of_node ;
75
75
const struct of_device_id * match = NULL ;
76
76
struct pl353_smc_data * pl353_smc ;
77
- struct device_node * child ;
78
77
79
78
pl353_smc = devm_kzalloc (& adev -> dev , sizeof (* pl353_smc ), GFP_KERNEL );
80
79
if (!pl353_smc )
@@ -93,22 +92,20 @@ static int pl353_smc_probe(struct amba_device *adev, const struct amba_id *id)
93
92
amba_set_drvdata (adev , pl353_smc );
94
93
95
94
/* Find compatible children. Only a single child is supported */
96
- for_each_available_child_of_node (of_node , child ) {
95
+ for_each_available_child_of_node_scoped (of_node , child ) {
97
96
match = of_match_node (pl353_smc_supported_children , child );
98
97
if (!match ) {
99
98
dev_warn (& adev -> dev , "unsupported child node\n" );
100
99
continue ;
101
100
}
101
+ of_platform_device_create (child , NULL , & adev -> dev );
102
102
break ;
103
103
}
104
104
if (!match ) {
105
105
dev_err (& adev -> dev , "no matching children\n" );
106
106
return - ENODEV ;
107
107
}
108
108
109
- of_platform_device_create (child , NULL , & adev -> dev );
110
- of_node_put (child );
111
-
112
109
return 0 ;
113
110
}
114
111
You can’t perform that action at this time.
0 commit comments