ssam_get_controller(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ssam_get_controller ✨

okay so this one's from the Kernel API Manual and honestly bestie it's short and sweet and absolutely iconic for it πŸ’…


🌸 SYNOPSIS 🌸

struct ssam_controller * ssam_get_controller (void );

πŸŽ€ ARGUMENTS πŸŽ€

  • void β€” literally no arguments. nada. zero. nothing to pass in, bestie 🫢

πŸ’– DESCRIPTION πŸ’–

So what this does is it hands you back a reference to the SSAM controller of the system. and like… it can totally return NULL instead, if:

  • there isn't one at all,
  • it hasn't been set up yet, or
  • it has already been unregistered πŸ™ˆ

And here's the part you actually need to remember, no cap: this function automatically increments the reference count of the controller. so the calling party must make sure ssam_controller_put gets called once they don't need the controller anymore. like, that's on you, bestie, that's your responsibility πŸ”₯ don't leave it hanging, it's giving leak energy otherwise πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹


⭐ reminder: grab the controller β†’ get a refcount bump β†’ put it back when you're done. main character resource management, periodt πŸ‘‘

that's the whole vibe from ./drivers/platform/surface/agg... β€” October 2026 edition. mwah, go forth and put your controllers, bestie πŸ’œβœ¨

πŸ“¦ where this page comes from