.. | .. |
---|
157 | 157 | /* calculate number of maps required */ |
---|
158 | 158 | for_each_child_of_node(np_config, np) { |
---|
159 | 159 | ret = of_property_read_string(np, "st,function", &function); |
---|
160 | | - if (ret < 0) |
---|
| 160 | + if (ret < 0) { |
---|
| 161 | + of_node_put(np); |
---|
161 | 162 | return ret; |
---|
| 163 | + } |
---|
162 | 164 | |
---|
163 | 165 | ret = of_property_count_strings(np, "st,pins"); |
---|
164 | | - if (ret < 0) |
---|
| 166 | + if (ret < 0) { |
---|
| 167 | + of_node_put(np); |
---|
165 | 168 | return ret; |
---|
| 169 | + } |
---|
166 | 170 | |
---|
167 | 171 | count += ret; |
---|
168 | 172 | } |
---|
.. | .. |
---|
354 | 358 | struct spear_pinctrl_machdata *machdata) |
---|
355 | 359 | { |
---|
356 | 360 | struct device_node *np = pdev->dev.of_node; |
---|
357 | | - struct resource *res; |
---|
358 | 361 | struct spear_pmx *pmx; |
---|
359 | 362 | |
---|
360 | 363 | if (!machdata) |
---|
.. | .. |
---|
364 | 367 | if (!pmx) |
---|
365 | 368 | return -ENOMEM; |
---|
366 | 369 | |
---|
367 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
368 | | - pmx->vbase = devm_ioremap_resource(&pdev->dev, res); |
---|
| 370 | + pmx->vbase = devm_platform_ioremap_resource(pdev, 0); |
---|
369 | 371 | if (IS_ERR(pmx->vbase)) |
---|
370 | 372 | return PTR_ERR(pmx->vbase); |
---|
371 | 373 | |
---|