/* * Subject to the GPL, version 2. */ #include "xmalloc.h" struct panic_handler { void *arg; pid_t pid; bool is_enabled; void (*on_panic)(void *arg); struct panic_handler *next; }; static struct panic_handler *panic_handlers; void panic_handler_add(void (*on_panic)(void *arg), void *arg) { struct panic_handler *handler = xmallocz(sizeof(*handler)); handler->arg = arg; handler->pid = getpid(); handler->is_enabled = true; handler->on_panic = on_panic; handler->next = panic_handlers; panic_handlers = handler; }; void call_panic_handlers(void) { struct panic_handler *it; pid_t pid = getpid(); for (it = panic_handlers; it; it = it->next) { if (it->pid == pid && it->is_enabled) { it->is_enabled = false; it->on_panic(it->arg); } } } gi/'>index : net-next.git
net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2016-05-31 13:34:59 +0300
committerMark Brown <broonie@kernel.org>2016-05-31 14:37:08 +0100
commita2ebd58627e9aa486fccbbdda6338675bdf3e267 (patch)
tree839224cc378467743d2acedea1647173f7bcecef /sound
parent1a695a905c18548062509178b98bc91e67510864 (diff)
ASoC: ak4642: Implement suspend callback
Add the suspend callback to accompany the existing resume operation. With the suspend/resume callbacks the regmap (regcache) state handling can follow the recommended sequence. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')