devres_for_each_res(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 for fn β€” and yes it's literally the 3rd parameter of fn, 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 🫢:

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