@@ -151,24 +151,19 @@ static int spear_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
151
151
unsigned * num_maps )
152
152
{
153
153
struct spear_pmx * pmx = pinctrl_dev_get_drvdata (pctldev );
154
- struct device_node * np ;
155
154
struct property * prop ;
156
155
const char * function , * group ;
157
156
int ret , index = 0 , count = 0 ;
158
157
159
158
/* calculate number of maps required */
160
- for_each_child_of_node (np_config , np ) {
159
+ for_each_child_of_node_scoped (np_config , np ) {
161
160
ret = of_property_read_string (np , "st,function" , & function );
162
- if (ret < 0 ) {
163
- of_node_put (np );
161
+ if (ret < 0 )
164
162
return ret ;
165
- }
166
163
167
164
ret = of_property_count_strings (np , "st,pins" );
168
- if (ret < 0 ) {
169
- of_node_put (np );
165
+ if (ret < 0 )
170
166
return ret ;
171
- }
172
167
173
168
count += ret ;
174
169
}
@@ -182,7 +177,7 @@ static int spear_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
182
177
if (!* map )
183
178
return - ENOMEM ;
184
179
185
- for_each_child_of_node (np_config , np ) {
180
+ for_each_child_of_node_scoped (np_config , np ) {
186
181
of_property_read_string (np , "st,function" , & function );
187
182
of_property_for_each_string (np , "st,pins" , prop , group ) {
188
183
(* map )[index ].type = PIN_MAP_TYPE_MUX_GROUP ;
0 commit comments