ssam_get_controller(9)
β¨ 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 π¦
- Kernel file
./drivers/platform/surface/aggregator/core.c ssam_try_set_controller(9)ssam_clear_controller(9)ssam_client_link(9)ssam_client_bind(9)
β 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
- 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