rio_dev_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rio_dev_get (9) β€” Kernel API Manual πŸŽ€

okay bestie, welcome to rio_dev_get, a little function from the <pink>Kernel API Manual</pink>, section 9 (that's the kernel-routine section, iykyk). it's a tiny one but it's lowkey important, so let's get into it ✨


🌸 NAME 🌸

rio_dev_get β€” increments the reference count of the RIO device structure

like, it bumps the refcount. that's the whole vibe. 🫢


✨ SYNOPSIS ✨

struct rio_dev * rio_dev_get (struct rio_dev *rdev );

okay so look at that signature β€” it takes a struct rio_dev * and hands you back a struct rio_dev *. very "you get the same thing back, but now it's more referenced" energy. main character function fr πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • rdev β€” the RIO device being referenced πŸŽ€

that's it. that's the single argument. one (1) device, please and thank you.


πŸ’– DESCRIPTION πŸ’–

okay so the whole rule here is: each live reference to a device should be refcounted. like, every reference you're holding onto needs to be counted properly. no cap, that's just how it works. 🌈

and here's how drivers for RIO devices are supposed to do it:

  • record those references in their probe methods, when they bind to a device 🧚
  • release them by calling rio_dev_put, in their disconnect methods πŸ’€

so it's a whole matched set β€” you get in probe, you put in disconnect. rio_dev_get on the way in, rio_dev_put on the way out. symmetry slay πŸ‘‘

fr fr don't forget the rio_dev_put β€” every get needs a put, that's the whole bit πŸ’€

⭐ SEE ALSO ⭐

the kernel file is ./drivers/rapidio/rio-driver.c (yes, that's where the magic lives), and here's the whole friend group:

go read them. they're all icons in their own right. 🌸


mwah πŸ’‹ β€” this page is brought to you by the source dir ./drivers/rapidio, dated October 2026, and yeah, the footer says rio_dev_get(9) again because consistency is iconic. byeee bestie 🫢✨

πŸ“¦ where this page comes from