i2c_get_adapter_by_fwnode(9)
π
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β astruct fwnode_handlethat corresponds to thestruct 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:
i2c_verify_client(9)i2c_adapter_lock_bus(9)i2c_adapter_trylock_bus(9)i2c_adapter_unlock_bus(9)i2c_new_client_device(9)i2c_unregister_device(9)i2c_find_device_by_fwnode(9)i2c_new_dummy_device(9)devm_i2c_new_dummy_device(9)i2c_new_ancillary_device(9)i2c_verify_adapter(9)i2c_handle_smbus_host_notify(9)i2c_add_adapter(9)i2c_add_numbered_adapter(9)i2c_del_adapter(9)devm_i2c_add_adapter(9)i2c_find_adapter_by_fwnode(9)i2c_parse_fw_timings(9)i2c_del_driver(9)__i2c_transfer(9)i2c_transfer(9)i2c_transfer_buffer_flags(9)i2c_get_device_id(9)i2c_client_get_device_id(9)i2c_get_dma_safe_msg_buf(9)i2c_put_dma_safe_msg_buf(9)
π 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
- 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