gpio_device_to_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

gpio_device_to_device β€” bestie, this is the one that hands you the address of the underlying struct device. Just the address. That's the whole gig. 🫢


✨ SYNOPSIS

struct device * gpio_device_to_device (struct gpio_device *gdev );

πŸŽ€ ARGUMENTS

  • gdev β€” the GPIO device you're asking about. You give it this, it gives you the address back. Cut and dry, no drama. πŸ’…

πŸ¦‹ DESCRIPTION

Okay so here's the thing, and it's lowkey the most important part of this whole function:

This does not increase the reference count of the GPIO device, and it does not increase the reference count of the underlying struct device either.

No refcount bump. None. Zero. Not a single one. 😭

So like, it's giving "here's the address, good luck out there" energy β€” it hands you the pointer and then it's your problem to make sure that thing doesn't get yanked out from under you. Nobody's holding it down for you. Keep that in mind and you'll be fine, fr fr. πŸ’€


⭐ RETURN

The address of the struct device that backs this GPIO device. That's it, that's the return value. Iconic, honestly. πŸ‘‘


🌈 SEE ALSO

Kernel file ./drivers/gpio/gpiolib.c, plus literally the entire extended gpio family β€” we're doing a whole reunion episode here, buckle up bestie:


That's the whole thing, bestie β€” go forth and pointer responsibly. 🌸

Drop-in location: ./drivers/gpio Β· dated October 2026 Β· that's the tea, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from