fb_notify.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * linux/drivers/video/fb_notify.c
  3. *
  4. * Copyright (C) 2006 Antonino Daplas <adaplas@pol.net>
  5. *
  6. * 2001 - Documented with DocBook
  7. * - Brad Douglas <brad@neruo.com>
  8. *
  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.
  12. */
  13. #include <linux/fb.h>
  14. #include <linux/notifier.h>
  15. #include <linux/export.h>
  16. static BLOCKING_NOTIFIER_HEAD(fb_notifier_list);
  17. /**
  18. * fb_register_client - register a client notifier
  19. * @nb: notifier block to callback on events
  20. */
  21. int fb_register_client(struct notifier_block *nb)
  22. {
  23. return blocking_notifier_chain_register(&fb_notifier_list, nb);
  24. }
  25. EXPORT_SYMBOL(fb_register_client);
  26. /**
  27. * fb_unregister_client - unregister a client notifier
  28. * @nb: notifier block to callback on events
  29. */
  30. int fb_unregister_client(struct notifier_block *nb)
  31. {
  32. return blocking_notifier_chain_unregister(&fb_notifier_list, nb);
  33. }
  34. EXPORT_SYMBOL(fb_unregister_client);
  35. /**
  36. * fb_notifier_call_chain - notify clients of fb_events
  37. *
  38. */
  39. int fb_notifier_call_chain(unsigned long val, void *v)
  40. {
  41. return blocking_notifier_call_chain(&fb_notifier_list, val, v);
  42. }
  43. EXPORT_SYMBOL_GPL(fb_notifier_call_chain);