device_find_any_child(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… device_find_any_child(9) β€” the kernel API manual, but make it make sense

okay so bestie, welcome to section 9 of the Kernel API Manual, and today's main character is device_find_any_child(9). yes it's a real function. yes it's iconic. let's get into it πŸŽ€


✨ NAME ✨

device_find_any_child β€” a device iterator that's literally just here to locate a child device, if there even is one. lowkey the chillest iterator in the family πŸ¦‹


✨ SYNOPSIS ✨

struct device * device_find_any_child (struct device *parent );

that's it. that's the whole vibe. one argument, one return, no drama πŸ’…


✨ ARGUMENTS ✨

  • parent β€” the parent struct device. like, the actual parent device struct you're asking about. it's giving family tree energy 🌸

✨ DESCRIPTION ✨

so this one is similar to the device_find_child function above it (iykyk), BUT β€” and this is the slay part β€” instead of whatever that one does, it returns a reference to a child device, if any. fr fr, that's the whole bit. if there's a child, you get a reference to it. no cap πŸ‘‘


✨ NOTE ✨

🚨 bestie listen to me 🚨 you will need to drop that reference with put_device after use. do not leave it hanging. that's a leak and we don't do leaks in this house 😭

✨ SEE ALSO ✨

okay this list is long but every single one of these is required reading, no skipping πŸ™ˆ


and that's the page!! 🫢 this whole thing lives in ./include/linux and it's dated October 2026 β€” so yeah, mark your calendars bestie, this manual page is from the future and it ate πŸ’–β­πŸ‘‘

πŸ“¦ where this page comes from