devres_for_each_res(9)
β¨ devres_for_each_res π
okay so bestie, this is a page from the Kernel API Manual and honestly? it's giving "underrated little iterator" and i need you to appreciate it π«Ά
πΈ NAME πΈ
devres_for_each_res β the Resource iterator. that's it, that's the whole name, and it ate π
π SYNOPSIS π
void devres_for_each_res (struct device *dev , dr_release_t release ,
dr_match_t match , void *match_data , void (*fn)(struct device *, void
*, void *) , void *data );
look at her. six params. main character energy fr fr β¨
π¦ ARGUMENTS π¦
devβ the Device you're iterating resources from. like, this is the whole vibe-check starting point, k? πreleaseβ you're looking for resources that are associated with this release function, so it's basically the matching key for the release side of things πmatchβ the Match function β and listen, she's optional, no cap πmatch_dataβ the Data that gets handed to that match function. feed her well πfnβ the Function that gets called for each matched resource. this is the callback that does the actual slaying π₯dataβ Data forfnβ and yes it's literally the 3rd parameter offn, so it all lines up, iykyk β
π DESCRIPTION π
the tea β: it calls fn for each devres of dev which is associated with release and for which match returns 1.
that's it. that's the whole description. simple, iconic, no notes π
π RETURN π
void
(nothing comes back. she gives, she doesn't take ππ)
πΈ SEE ALSO πΈ
the Kernel file ./drivers/base/devres.c and honestly her entire friend group π«Ά:
__devres_alloc_node(9)devres_free(9)devres_add(9)devres_find(9)devres_get(9)devres_remove(9)devres_destroy(9)devres_release(9)devres_release_all(9)devres_open_group(9)devres_close_group(9)devres_remove_group(9)devres_release_group(9)__devm_add_action(9)devm_remove_action_nowarn(9)devm_release_action(9)devm_kmalloc(9)devm_krealloc(9)devm_kstrdup(9)devm_kstrdup_const(9)devm_kvasprintf(9)devm_kasprintf(9)devm_kfree(9)devm_kmemdup(9)devm_kmemdup_const(9)devm_get_free_pages(9)devm_free_pages(9)__devm_alloc_percpu(9)
like, that's a whole squad and they all showed up πβ¨
k so that's the whole page bestie, go forth and iterate responsibly π π§
and finally, the cute little sign-off you asked for: this one comes from the source ./drivers/base and it's dated October 2026 β so yeah, she's from the future and she's still iconic ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms