of_find_device_by_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

Okay so this is of_find_device_by_node(9) from the Kernel API Manual, bestie β€” it finds the platform_device associated with a node. Iconic behavior, honestly. πŸ’…


✨ SYNOPSIS ✨

struct platform_device * of_find_device_by_node (struct device_node *np
);

🌸 ARGUMENTS 🌸

  • np β€” pointer to a device tree node πŸ¦‹

πŸ’– DESCRIPTION πŸ’–

So this one takes a reference to the embedded struct device β€” and bestie, that reference needs to be dropped after use. Don’t forget, fr fr πŸ˜­πŸ’€


🫢 RETURN 🫢

Returns a platform_device pointer, or NULL if not found. That’s the whole vibe check πŸ‘‘βœ¨


🌈 SEE ALSO 🌈

Kernel file ./drivers/of/platform.c plus the whole friend group:


Big sparkly kiss from ./drivers/of, dated October 2026, signed of_find_device_by_node(9) πŸ’ŒπŸŽ€βœ¨

πŸ“¦ where this page comes from