55 lines · c
1/*2 * linux/drivers/video/fb_notify.c3 *4 * Copyright (C) 2006 Antonino Daplas <adaplas@pol.net>5 *6 * 2001 - Documented with DocBook7 * - Brad Douglas <brad@neruo.com>8 *9 * This file is subject to the terms and conditions of the GNU General Public10 * License. See the file COPYING in the main directory of this archive11 * for more details.12 */13#include <linux/fb.h>14#include <linux/notifier.h>15#include <linux/export.h>16 17static BLOCKING_NOTIFIER_HEAD(fb_notifier_list);18 19/**20 * fb_register_client - register a client notifier21 * @nb: notifier block to callback on events22 *23 * Return: 0 on success, negative error code on failure.24 */25int fb_register_client(struct notifier_block *nb)26{27 return blocking_notifier_chain_register(&fb_notifier_list, nb);28}29EXPORT_SYMBOL(fb_register_client);30 31/**32 * fb_unregister_client - unregister a client notifier33 * @nb: notifier block to callback on events34 *35 * Return: 0 on success, negative error code on failure.36 */37int fb_unregister_client(struct notifier_block *nb)38{39 return blocking_notifier_chain_unregister(&fb_notifier_list, nb);40}41EXPORT_SYMBOL(fb_unregister_client);42 43/**44 * fb_notifier_call_chain - notify clients of fb_events45 * @val: value passed to callback46 * @v: pointer passed to callback47 *48 * Return: The return value of the last notifier function49 */50int fb_notifier_call_chain(unsigned long val, void *v)51{52 return blocking_notifier_call_chain(&fb_notifier_list, val, v);53}54EXPORT_SYMBOL_GPL(fb_notifier_call_chain);55