ssam_nf_refcount_dec(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ssam_nf_refcount_dec(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual (section 9, the cool section) β€” today's main character is ssam_nf_refcount_dec, and honestly? she's a little bookkeeping queen. let's get into it 🫢


✨ NAME ✨

ssam_nf_refcount_dec β€” decrement the reference-/activation-count of the given event. that's it, that's the vibe πŸŽ€


🌸 SYNOPSIS 🌸

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

πŸŽ€ ARGUMENTS πŸŽ€

  • nf β€” the notifier system reference. your notifier-system bestie, the one holding everything together πŸ’–
  • reg β€” the registry used to enable/disable the event. lowkey the switchboard πŸ¦‹
  • id β€” the event ID. literally which event we're talking about πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

so what she does: she decrements the reference-/activation-count of the specified event, and returns its entry. that's the whole errand ✨

and here's the part you do NOT skip: if the returned entry has a refcount of zero, the caller is responsible for freeing it using kfree. your entry, your cleanup, no cap πŸ§ΉπŸ’€


πŸ”₯ NOTE πŸ”₯

nf->lock must be held when calling this function. like, this is not a suggestion, bestie, this is the vibe check you must pass before you call her πŸ™ˆ

⭐ RETURN ⭐

returns the refcount entry on success, or NULL if the entry has not been found. icon behavior, honestly β€” instead of crashing dramatically she just hands you a NULL and minds her business πŸ’…


🌈 SEE ALSO 🌈

the whole friend group shows up, in exactly this order β€” no one gets left out, periodt:

the kernel file ./drivers/platform/surface/aggregator/controller.c, then ssh_seq_reset(9), ssh_seq_next(9), ssh_rqid_reset(9), ssh_rqid_next(9), ssam_event_matches_notifier(9), ssam_nfblk_call_chain(9), ssam_nfblk_insert(9), ssam_nfblk_find(9), ssam_nfblk_remove(9), ssam_nf_head_init(9), ssam_nf_head_destroy(9), struct ssam_nf_refcount_key(9), struct ssam_nf_refcount_entry(9), ssam_nf_refcount_inc(9), ssam_nf_refcount_dec_free(9), ssam_nf_refcount_empty(9), ssam_nf_call(9), ssam_nf_init(9), ssam_nf_destroy(9), ssam_event_item_cache_init(9), ssam_event_item_cache_destroy(9), ssam_event_item_free(9), ssam_event_item_alloc(9), ssam_event_queue_push(9), ssam_event_queue_pop(9), ssam_event_queue_is_empty(9), ssam_cplt_get_event_queue(9), ssam_cplt_submit(9), ssam_cplt_submit_event(9), ssam_cplt_flush(9), ssam_event_queue_init(9), ssam_cplt_init(9), ssam_cplt_destroy(9).

and continuing the squad: ssam_controller_device(9), ssam_controller_get(9), ssam_controller_put(9), ssam_controller_statelock(9), ssam_controller_stateunlock(9), ssam_controller_lock(9), ssam_controller_caps_load_from_acpi(9), ssam_controller_caps_load_from_of(9), ssam_controller_caps_load(9), ssam_controller_init(9), ssam_controller_start(9), ssam_controller_shutdown(9), ssam_controller_destroy(9), ssam_controller_suspend(9), ssam_controller_resume(9), ssam_request_write_data(9), ssam_request_sync_alloc(9), ssam_request_sync_free(9), ssam_request_sync_init(9), ssam_request_sync_submit(9), ssam_request_do_sync(9), ssam_request_do_sync_with_buffer(9), struct ssh_notification_params(9), ssam_ssh_event_enable(9), ssam_ssh_event_disable(9), ssam_get_firmware_version(9), ssam_ctrl_notif_display_off(9), ssam_ctrl_notif_display_on(9), ssam_ctrl_notif_d0_exit(9), ssam_ctrl_notif_d0_entry(9).

and the final stretch, still in order, still iconic: ssam_nf_refcount_enable(9), ssam_nf_refcount_disable_free(9), ssam_notifier_register(9), __ssam_notifier_unregister(9), ssam_controller_event_enable(9), ssam_controller_event_disable(9), ssam_notifier_disable_registered(9), ssam_notifier_restore_registered(9), ssam_notifier_is_empty(9), ssam_notifier_unregister_all(9), ssam_irq_setup(9), ssam_irq_free(9), ssam_irq_arm_for_wakeup(9), ssam_irq_disarm_wakeup(9).


and that's the page, bestie πŸ’œ mwah πŸ’‹ β€” sourced from ./drivers/platform/surface/agg..., dated October 2026, ssam_nf_refcount_dec(9) signing off 🌟

πŸ“¦ where this page comes from