i2c_get_adapter_by_fwnode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… i2c_get_adapter_by_fwnode β€” the i2c_adapter manual, bestie edition

okay so real talk: this page is a Kernel API Manual entry, and the function is literally called i2c_get_adapter_by_fwnode. Say it with your chest. πŸŽ€


✨ NAME ✨

i2c_get_adapter_by_fwnode β€” find an i2c_adapter for the fwnode. that's it. that's the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

struct i2c_adapter * i2c_get_adapter_by_fwnode (struct fwnode_handle
*fwnode );

like yes she takes one argument and returns a pointer, she's lowkey low-maintenance πŸ’…


✨ ARGUMENTS ✨

  • fwnode β€” a struct fwnode_handle that corresponds to the struct i2c_adapter. that's your little handle bestie, she's the matching key πŸŽ€

✨ DESCRIPTION ✨

so basically ✨ she looks up the struct i2c_adapter that corresponds to the fwnode and returns it, and she increments the adapter module's use count. two things, one function, main character energy πŸ‘‘

if no adapter can be found, or if fwnode is NULL, she returns NULL. no adapter, no problem, just NULL. πŸ’€

⚠️ okay this part matters, do not skip it: the user must call i2c_put_adapter(adapter) once they're done with the i2c adapter. like, you gotta give her back. no cap.

and ngl, note that this is different from i2c_find_adapter_by_node. not the same function, not the same behavior, don't mix them up πŸ™ˆ


✨ SEE ALSO ✨

kernel file ./drivers/i2c/i2c-core-base.c (yes, that's where she lives 🏠) and her whole friend group:


πŸ’– that's the whole page babes πŸ’– signed, sealed, delivered from ./drivers/i2c, dated October 2026 β€” this Kernel API Manual moment is officially a wrap, slay 🫢🌸

πŸ“¦ where this page comes from