get_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… get_device β€” like, the manual page bestie

ok so this is get_device(9), straight out of the Kernel API Manual. Grab a snack, we're bumping a refcount together 🫢


✨ NAME ✨

get_device β€” increment reference count for device.

That's it. That's the whole job. She's a one-trick pony and honestly? The pony ate. πŸ”₯

🌸 SYNOPSIS 🌸

struct device * get_device (struct device *dev );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device. The device in question. The one and only. πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea: get_device literally just forwards the call over to kobject_get πŸ’Œ β€” no extra layers, no secret sauce, it's giving "middleman who's actually useful".

But! And this is the part where she's a considerate icon ✨ β€” she does take care to provide for the case that we get a NULL pointer passed in. So if dev is NULL, she's got you. Not me checking for NULL before dereferencing, couldn't be her πŸ’… (jk it literally is her, that's the whole point).

ngl, the entire description is "it delegates + it handles NULL". That's it. That's the lore. No cap. 😭

⭐ SEE ALSO ⭐

ok buckle up bestie, this list is LONG, we're in Kernel file ./drivers/base/core.c territory 🌈 β€” all of these are (9):

iykyk 🧚


and that's the whole page, bestie β€” dropping from ./drivers/base with a date stamp of October 2026, all wrapped up in the Kernel API Manual πŸ’– periodt. go forth and bump that refcount responsibly πŸŽ€πŸŒŸ

πŸ“¦ where this page comes from