i2c_find_device_by_fwnode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ i2c_find_device_by_fwnode ✨

okay bestie, so this is a page from the Kernel API Manual (yes, the Kernel API Manual, we're in the big leagues now 🫢), and it's all about one very specific little lookup function. it's short, it's sweet, and it's lowkey important. let's get into it πŸ’…


🌸 NAME 🌸

i2c_find_device_by_fwnode β€” find an i2c_client for the fwnode. that's it. that's the whole vibe. πŸŽ€


⭐ SYNOPSIS ⭐

struct i2c_client * i2c_find_device_by_fwnode (struct fwnode_handle
*fwnode );

like, you hand it a fwnode, it hands you back a struct i2c_client *. classic trade, no cap 🀝


πŸ¦‹ ARGUMENTS πŸ¦‹

  • fwnode β€” the struct fwnode_handle that corresponds to the struct i2c_client you're chasing. this is your little "hey, this firmware node right here, that's the one" receipt 🧾✨

πŸ’– DESCRIPTION πŸ’–

so what does it do? it looks up the struct i2c_client that corresponds to fwnode, and returns it. that's the main character move 🌟

and here's the fine print, because of course there's fine print:

  • if no client can be found, it returns NULL 🫠
  • if fwnode is NULL, it also returns NULL β€” so yeah, null in, null out, no drama, no crash πŸ™ˆ
⚠️ important bestie!! the user must call put_device(client->dev) once you're done with the i2c client. this is not optional, this is not a suggestion, this is the rules. forget it and you're leaking, and not in the cute way 😭 please release your device. periodt πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file lives at ./drivers/i2c/i2c-core-base.c β€” that's home base 🏠

and here's the whole friend group, enjoy the roll call πŸŽ‰:

like, the whole i2c extended universe, fr fr 🌈


aaaand that's the page!! πŸ’œ this one came from ./drivers/i2c, dated October 2026, and it's filed under i2c_find_device_by_fwnode(9). go forth and remember your put_device() bestie, i'm rooting for you πŸ«ΆπŸŽ€βœ¨

πŸ“¦ where this page comes from