Commit dea90ac
leds: pca963x: 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().
After switching to the scoped variant, there is no longer need for a
jump to 'err', as an immediate return is possible.
Signed-off-by: Javier Carrasco <[email protected]>
Link: https://lore.kernel.org/r/20240927-leds_device_for_each_child_node_scoped-v1-13-95c0614b38c8@gmail.com
Signed-off-by: Lee Jones <[email protected]>1 parent 5b5d936 commit dea90ac
1 file changed
+3
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
310 | 309 | | |
311 | 310 | | |
312 | 311 | | |
| |||
338 | 337 | | |
339 | 338 | | |
340 | 339 | | |
341 | | - | |
| 340 | + | |
342 | 341 | | |
343 | 342 | | |
344 | 343 | | |
345 | 344 | | |
346 | 345 | | |
347 | 346 | | |
348 | 347 | | |
349 | | - | |
350 | | - | |
| 348 | + | |
351 | 349 | | |
352 | 350 | | |
353 | 351 | | |
| |||
369 | 367 | | |
370 | 368 | | |
371 | 369 | | |
372 | | - | |
| 370 | + | |
373 | 371 | | |
374 | 372 | | |
375 | 373 | | |
376 | 374 | | |
377 | 375 | | |
378 | 376 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | 377 | | |
383 | 378 | | |
384 | 379 | | |
| |||
0 commit comments