ssam_nf_refcount_inc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ssam_nf_refcount_inc ✨

okay so you're in the Kernel API Manual bestie, and today's main character is ssam_nf_refcount_inc β€” the little function that bumps the refcount on an event. slay. let's get into it πŸ’…


🌸 NAME 🌸

ssam_nf_refcount_inc β€” increments the reference-/activation-count of the given event. that's it. that's the whole vibe. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

struct ssam_nf_refcount_entry * ssam_nf_refcount_inc (struct ssam_nf *nf
, struct ssam_event_registry reg , struct ssam_event_id id );

look at her. three params, returns a pointer, fully iconic. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • nf β€” the notifier system reference. your notifier-system bestie, basically.
  • reg β€” the registry used to enable/disable the event. this is the one that says "hey, turn this on/off."
  • id β€” the event ID. the event's whole identity, honestly.

πŸ’– DESCRIPTION πŸ’–

so what she does: she increments the reference-/activation-count that's associated with the specified event type/ID. and if there's no entry for that event ID yet? she allocates a new one for you. no big deal. 🫢

and just so we're clear β€” a newly allocated entry will have a refcount of one. not zero. one. got it? ✨


⚠️ NOTE ⚠️

nf->lock must be held when calling this function. like, actually must. this is not a suggestion, bestie. hold the lock. πŸ”’πŸ’€

🌈 RETURN 🌈

  • on success: returns the refcount entry. πŸŽ‰
  • on sadness: returns an error pointer with -ENOSPC if there have already been INT_MAX events of the specified ID and type registered 😭
  • or an error pointer with -ENOMEM if the entry could not be allocated. rough out here fr fr.

πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file: ./drivers/platform/surface/aggregator/controller.c

and the whole friend group, no cap β€” every single one:

that's the whole group chat right there, iykyk πŸ’œ


and that's the page!! brought to you by the source <code>./drivers/platform/surface/agg...</code> and dated October 2026 β€” mwah, xoxo, go hold that lock πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from