Commit 8cf103d
leds: sun50i-a100: Switch to device_for_each_child_node_scoped()
Switch to device_for_each_child_node_scoped() to simplify the code by
removing the need for calls to fwnode_handle_put() in the error paths.
This also prevents possible memory leaks if new error paths are added
without the required call to fwnode_handle_put().
The error handling after 'err_put_child' has been moved to the only goto
that jumps to it (second device_for_each_child_node()), and the call to
fwnode_handle_put() has been removed accordingly.
Signed-off-by: Javier Carrasco <[email protected]>
Link: https://lore.kernel.org/r/20240927-leds_device_for_each_child_node_scoped-v1-15-95c0614b38c8@gmail.com
Signed-off-by: Lee Jones <[email protected]>1 parent e345607 commit 8cf103d
1 file changed
+9
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
396 | 395 | | |
397 | 396 | | |
398 | 397 | | |
| |||
402 | 401 | | |
403 | 402 | | |
404 | 403 | | |
405 | | - | |
| 404 | + | |
406 | 405 | | |
407 | 406 | | |
408 | 407 | | |
409 | | - | |
410 | | - | |
| 408 | + | |
411 | 409 | | |
412 | 410 | | |
413 | | - | |
414 | 411 | | |
415 | 412 | | |
416 | | - | |
417 | | - | |
| 413 | + | |
418 | 414 | | |
419 | | - | |
420 | 415 | | |
421 | 416 | | |
422 | 417 | | |
| |||
502 | 497 | | |
503 | 498 | | |
504 | 499 | | |
505 | | - | |
| 500 | + | |
506 | 501 | | |
507 | 502 | | |
508 | 503 | | |
| |||
527 | 522 | | |
528 | 523 | | |
529 | 524 | | |
530 | | - | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
531 | 530 | | |
532 | 531 | | |
533 | 532 | | |
| |||
536 | 535 | | |
537 | 536 | | |
538 | 537 | | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | 538 | | |
548 | 539 | | |
549 | 540 | | |
| |||
0 commit comments