device_find_any_child(9)
π 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 parentstruct 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 π
- Kernel file
./include/linux/device.h struct subsys_interface(9)struct device_attribute(9)struct dev_ext_attribute(9)DEVICE_ATTR(9)DEVICE_ATTR_RW(9)DEVICE_ATTR_ADMIN_RW(9)DEVICE_ATTR_RW_NAMED(9)DEVICE_ATTR_RO(9)DEVICE_ATTR_ADMIN_RO(9)DEVICE_ATTR_RO_NAMED(9)DEVICE_ATTR_WO(9)DEVICE_ATTR_WO_NAMED(9)DEVICE_ULONG_ATTR(9)DEVICE_INT_ATTR(9)DEVICE_BOOL_ATTR(9)DEVICE_STRING_ATTR_RO(9)enum device_link_state(9)enum dl_dev_state(9)enum device_removable(9)struct dev_links_info(9)struct dev_msi_info(9)enum device_physical_location_panel(9)enum device_physical_location_vertical_position(9)enum device_physical_location_horizontal_position(9)struct device_physical_location(9)enum struct_device_flags(9)struct device(9)struct device_link(9)device_set_driver_override(9)device_has_driver_override(9)device_match_driver_override(9)device_iommu_mapped(9)dev_name(9)dev_bus_name(9)device_find_child_by_name(9)device_lock_set_class(9)device_lock_reset_class(9)
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
- 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