Hi all!

I encountered a problem while compiling VISDN for a 2.6.17.6 kernel.
After some digging, I came up with the following patch so that the modules
would compile cleanly again.

The style may not be very good - I haven't been coding in C for several 
years :-(

Hope it helps some of you.

------------------- [ cut ] -------------------
--- /usr/src/visdn-head.orig/modules/core/core_main.c   2006-07-21 
08:00:06.000000000 +0200
+++ /usr/src/visdn-head/modules/core/core_main.c        2006-07-21 
23:03:13.000000000 +0200
@@ -17,6 +17,7 @@
 #include <linux/cdev.h>
 #include <linux/kdev_t.h>
 #include <linux/device.h>
+#include <linux/notifier.h>

 #include <kernel_config.h>

@@ -74,22 +75,26 @@
 EXPORT_SYMBOL(visdn_system_device);--- 
/usr/src/visdn-head.orig/modules/core/core_main.c   
2006-07-21 08:00:06.000000000 +0200
+++ /usr/src/visdn-head/modules/core/core_main.c        2006-07-21 
23:03:13.000000000 +0200
@@ -17,6 +17,7 @@
 #include <linux/cdev.h>
 #include <linux/kdev_t.h>
 #include <linux/device.h>
+#include <linux/notifier.h>

 #include <kernel_config.h>

@@ -74,22 +75,26 @@
 EXPORT_SYMBOL(visdn_system_device);

 static struct notifier_block *visdn_notify_chain;
+static struct raw_notifier_head visdn_notify_chain_head;

 int visdn_register_notifier(struct notifier_block *nb)
 {
-       return notifier_chain_register(&visdn_notify_chain, nb);
+       visdn_notify_chain_head.head = visdn_notify_chain;
+       return raw_notifier_chain_register(&visdn_notify_chain_head, nb);
 }
 EXPORT_SYMBOL(visdn_register_notifier);

 int visdn_unregister_notifier(struct notifier_block *nb)
 {
-       return notifier_chain_unregister(&visdn_notify_chain, nb);
+       visdn_notify_chain_head.head = visdn_notify_chain;
+       return raw_notifier_chain_unregister(&visdn_notify_chain_head, nb);
 }
 EXPORT_SYMBOL(visdn_unregister_notifier);

 int visdn_call_notifiers(unsigned long val, void *v)
 {
-       return notifier_call_chain(&visdn_notify_chain, val, v);
+       visdn_notify_chain_head.head = visdn_notify_chain;
+       return raw_notifier_call_chain(&visdn_notify_chain_head, val, v);
 }
 EXPORT_SYMBOL(visdn_call_notifiers);


 static struct notifier_block *visdn_notify_chain;
+static struct raw_notifier_head visdn_notify_chain_head;

 int visdn_register_notifier(struct notifier_block *nb)
 {
-       return notifier_chain_register(&visdn_notify_chain, nb);
+       visdn_notify_chain_head.head = visdn_notify_chain;
+       return raw_notifier_chain_register(&visdn_notify_chain_head, nb);
 }
 EXPORT_SYMBOL(visdn_register_notifier);

 int visdn_unregister_notifier(struct notifier_block *nb)
 {
-       return notifier_chain_unregister(&visdn_notify_chain, nb);
+       visdn_notify_chain_head.head = visdn_notify_chain;
+       return raw_notifier_chain_unregister(&visdn_notify_chain_head, nb);
 }
 EXPORT_SYMBOL(visdn_unregister_notifier);

 int visdn_call_notifiers(unsigned long val, void *v)
 {
-       return notifier_call_chain(&visdn_notify_chain, val, v);
+       visdn_notify_chain_head.head = visdn_notify_chain;
+       return raw_notifier_call_chain(&visdn_notify_chain_head, val, v);
 }
 EXPORT_SYMBOL(visdn_call_notifiers);
------------------- [ cut ] -------------------


-- 
Nicolas Ouedraogo
Associate
SwissVON s.a.r.l
rue Michel-Chauvet 3
CH-1208 Geneva
Switzerland
sip:  [EMAIL PROTECTED]
tel.: +41 (22) 347-2137
fax:  +41 (22) 328-2626
_______________________________________________
Visdn-hackers mailing list
[email protected]
https://mailman.uli.it/mailman/listinfo/visdn-hackers

Reply via email to