Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / video / fbdev / core / fb_notify.c
blob10e3b9a74adcb267aad17cf59e88399cf904a7a7
1 /*
2 * linux/drivers/video/fb_notify.c
4 * Copyright (C) 2006 Antonino Daplas <adaplas@pol.net>
6 * 2001 - Documented with DocBook
7 * - Brad Douglas <brad@neruo.com>
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file COPYING in the main directory of this archive
11 * for more details.
13 #include <linux/fb.h>
14 #include <linux/notifier.h>
15 #include <linux/export.h>
17 static BLOCKING_NOTIFIER_HEAD(fb_notifier_list);
19 /**
20 * fb_register_client - register a client notifier
21 * @nb: notifier block to callback on events
23 * Return: 0 on success, negative error code on failure.
25 int fb_register_client(struct notifier_block *nb)
27 return blocking_notifier_chain_register(&fb_notifier_list, nb);
29 EXPORT_SYMBOL(fb_register_client);
31 /**
32 * fb_unregister_client - unregister a client notifier
33 * @nb: notifier block to callback on events
35 * Return: 0 on success, negative error code on failure.
37 int fb_unregister_client(struct notifier_block *nb)
39 return blocking_notifier_chain_unregister(&fb_notifier_list, nb);
41 EXPORT_SYMBOL(fb_unregister_client);
43 /**
44 * fb_notifier_call_chain - notify clients of fb_events
45 * @val: value passed to callback
46 * @v: pointer passed to callback
48 * Return: The return value of the last notifier function
50 int fb_notifier_call_chain(unsigned long val, void *v)
52 return blocking_notifier_call_chain(&fb_notifier_list, val, v);
54 EXPORT_SYMBOL_GPL(fb_notifier_call_chain);