Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  *  linux/drivers/video/fb_notify.c
0003  *
0004  *  Copyright (C) 2006 Antonino Daplas <adaplas@pol.net>
0005  *
0006  *  2001 - Documented with DocBook
0007  *  - Brad Douglas <brad@neruo.com>
0008  *
0009  * This file is subject to the terms and conditions of the GNU General Public
0010  * License.  See the file COPYING in the main directory of this archive
0011  * for more details.
0012  */
0013 #include <linux/fb.h>
0014 #include <linux/notifier.h>
0015 #include <linux/export.h>
0016 
0017 static BLOCKING_NOTIFIER_HEAD(fb_notifier_list);
0018 
0019 /**
0020  *  fb_register_client - register a client notifier
0021  *  @nb: notifier block to callback on events
0022  *
0023  *  Return: 0 on success, negative error code on failure.
0024  */
0025 int fb_register_client(struct notifier_block *nb)
0026 {
0027     return blocking_notifier_chain_register(&fb_notifier_list, nb);
0028 }
0029 EXPORT_SYMBOL(fb_register_client);
0030 
0031 /**
0032  *  fb_unregister_client - unregister a client notifier
0033  *  @nb: notifier block to callback on events
0034  *
0035  *  Return: 0 on success, negative error code on failure.
0036  */
0037 int fb_unregister_client(struct notifier_block *nb)
0038 {
0039     return blocking_notifier_chain_unregister(&fb_notifier_list, nb);
0040 }
0041 EXPORT_SYMBOL(fb_unregister_client);
0042 
0043 /**
0044  * fb_notifier_call_chain - notify clients of fb_events
0045  * @val: value passed to callback
0046  * @v: pointer passed to callback
0047  *
0048  * Return: The return value of the last notifier function
0049  */
0050 int fb_notifier_call_chain(unsigned long val, void *v)
0051 {
0052     return blocking_notifier_call_chain(&fb_notifier_list, val, v);
0053 }
0054 EXPORT_SYMBOL_GPL(fb_notifier_call_chain);