rio_dev_get(9)
π 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
probemethods, when they bind to a device π§ - release them by calling
rio_dev_put, in theirdisconnectmethods π
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:
rio_match_device(9)rio_dev_put(9)rio_device_probe(9)rio_device_remove(9)rio_register_driver(9)rio_unregister_driver(9)rio_match_bus(9)rio_bus_init(9)
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
- 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