Commit 9e445e2
leds: el15203000: 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_child_out', 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-6-95c0614b38c8@gmail.com
Signed-off-by: Lee Jones <[email protected]>1 parent 65135e2 commit 9e445e2
1 file changed
+4
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
241 | 240 | | |
242 | 241 | | |
243 | | - | |
| 242 | + | |
244 | 243 | | |
245 | 244 | | |
246 | 245 | | |
247 | 246 | | |
248 | 247 | | |
249 | | - | |
| 248 | + | |
250 | 249 | | |
251 | 250 | | |
252 | 251 | | |
253 | 252 | | |
254 | | - | |
255 | | - | |
| 253 | + | |
256 | 254 | | |
257 | 255 | | |
258 | 256 | | |
| |||
274 | 272 | | |
275 | 273 | | |
276 | 274 | | |
277 | | - | |
| 275 | + | |
278 | 276 | | |
279 | 277 | | |
280 | 278 | | |
281 | 279 | | |
282 | 280 | | |
283 | 281 | | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | 282 | | |
289 | 283 | | |
290 | 284 | | |
| |||
0 commit comments