hwmon: add TI ads7871 a/d converter driver
[safe/jmp/linux-2.6] / net / sched / ematch.c
index 5e6f82e..5e37da9 100644 (file)
@@ -71,7 +71,7 @@
  *
  *      static void __exit exit_my_ematch(void)
  *      {
- *             return tcf_em_unregister(&my_ops);
+ *             tcf_em_unregister(&my_ops);
  *      }
  *
  *      module_init(init_my_ematch);
@@ -82,6 +82,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -154,23 +155,11 @@ EXPORT_SYMBOL(tcf_em_register);
  *
  * Returns -ENOENT if no matching ematch was found.
  */
-int tcf_em_unregister(struct tcf_ematch_ops *ops)
+void tcf_em_unregister(struct tcf_ematch_ops *ops)
 {
-       int err = 0;
-       struct tcf_ematch_ops *e;
-
        write_lock(&ematch_mod_lock);
-       list_for_each_entry(e, &ematch_ops, link) {
-               if (e == ops) {
-                       list_del(&e->link);
-                       goto out;
-               }
-       }
-
-       err = -ENOENT;
-out:
+       list_del(&ops->link);
        write_unlock(&ematch_mod_lock);
-       return err;
 }
 EXPORT_SYMBOL(tcf_em_unregister);
 
@@ -224,7 +213,7 @@ static int tcf_em_validate(struct tcf_proto *tp,
 
                if (em->ops == NULL) {
                        err = -ENOENT;
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
                        __rtnl_unlock();
                        request_module("ematch-kind-%u", em_hdr->kind);
                        rtnl_lock();
@@ -538,7 +527,8 @@ pop_stack:
 
 stack_overflow:
        if (net_ratelimit())
-               printk("Local stack overflow, increase NET_EMATCH_STACK\n");
+               printk(KERN_WARNING "tc ematch: local stack overflow,"
+                       " increase NET_EMATCH_STACK\n");
        return -1;
 }
 EXPORT_SYMBOL(__tcf_em_tree_match);