]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
Change can_proto_unregister() and can_rx_unregister() to return void.
authorthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 19 Sep 2007 13:05:43 +0000 (13:05 +0000)
committerthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 19 Sep 2007 13:05:43 +0000 (13:05 +0000)
Change two DBG()s to printk(KERN_ERR).
Add KERN_ERR to two printk()s.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@475 030b6a49-0b11-0410-94ab-b0dab22257f2

kernel/2.6/net/can/af_can.c
kernel/2.6/net/can/bcm.c
kernel/2.6/net/can/raw.c

index 3077295fe7a7fa4a07f288595c5924a34cc8d51c..6dd8ff8501afbbc2f4f62369c580259dfd237749 100644 (file)
@@ -509,20 +509,14 @@ static void can_rx_delete_receiver(struct rcu_head *rp)
  *
  * Description:
  *  Removes subscription entry depending on given (subscription) values.
- *
- * Return:
- *  0 on success
- *  -EINVAL on missing subscription entry
- *  -ENODEV unknown device
  */
-int can_rx_unregister(struct net_device *dev, canid_t can_id, canid_t mask,
-                     void (*func)(struct sk_buff *, void *), void *data)
+void can_rx_unregister(struct net_device *dev, canid_t can_id, canid_t mask,
+                      void (*func)(struct sk_buff *, void *), void *data)
 {
        struct receiver *r = NULL;
        struct hlist_head *rl;
        struct hlist_node *next;
        struct dev_rcv_lists *d;
-       int ret = 0;
 
        DBG("dev %p (%s), id %03X, mask %03X, callback %p, data %p\n",
            dev, DNAME(dev), can_id, mask, func, data);
@@ -531,9 +525,9 @@ int can_rx_unregister(struct net_device *dev, canid_t can_id, canid_t mask,
 
        d = find_dev_rcv_lists(dev);
        if (!d) {
-               DBG("receive list not found for dev %s, id %03X, mask %03X\n",
-                   DNAME(dev), can_id, mask);
-               ret = -ENODEV;
+               printk(KERN_ERR "BUG: receive list not found for "
+                      "dev %s, id %03X, mask %03X\n",
+                      DNAME(dev), can_id, mask);
                goto out;
        }
 
@@ -558,9 +552,9 @@ int can_rx_unregister(struct net_device *dev, canid_t can_id, canid_t mask,
         */
 
        if (!next) {
-               DBG("receive list entry not found for "
-                   "dev %s, id %03X, mask %03X\n", DNAME(dev), can_id, mask);
-               ret = -EINVAL;
+               printk(KERN_ERR "BUG: receive list entry not found for "
+                      "dev %s, id %03X, mask %03X\n",
+                      DNAME(dev), can_id, mask);
                r = NULL;
                d = NULL;
                goto out;
@@ -590,8 +584,6 @@ int can_rx_unregister(struct net_device *dev, canid_t can_id, canid_t mask,
        /* schedule the device structure for deletion */
        if (d)
                call_rcu(&d->rcu, can_rx_delete_device);
-
-       return ret;
 }
 EXPORT_SYMBOL(can_rx_unregister);
 
@@ -779,25 +771,20 @@ EXPORT_SYMBOL(can_proto_register);
 /**
  * can_proto_unregister - unregister CAN transport protocol
  * @cp: pointer to CAN protocol structure
- *
- * Return:
- *  0 on success
- *  -ESRCH protocol number was not registered
  */
-int can_proto_unregister(struct can_proto *cp)
+void can_proto_unregister(struct can_proto *cp)
 {
        int proto = cp->protocol;
 
        if (!proto_tab[proto]) {
-               printk(KERN_ERR "can: protocol %d is not registered\n", proto);
-               return -ESRCH;
+               printk(KERN_ERR "BUG: can: protocol %d is not registered\n",
+                      proto);
+               return;
        }
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
        proto_unregister(cp->prot);
 #endif
        proto_tab[proto] = NULL;
-
-       return 0;
 }
 EXPORT_SYMBOL(can_proto_unregister);
 
index f50245c3ba2603c25bb02d15bec418d96a16da8e..465bc4780fc94e2af6a2acc94dba2ae4c464e9b2 100644 (file)
@@ -1859,7 +1859,7 @@ static int __init bcm_module_init(void)
 
        err = can_proto_register(&bcm_can_proto);
        if (err < 0) {
-               printk("can: registration of bcm protocol failed\n");
+               printk(KERN_ERR "can: registration of bcm protocol failed\n");
                return err;
        }
 
@@ -1878,10 +1878,7 @@ static int __init bcm_module_init(void)
 
 static void __exit bcm_module_exit(void)
 {
-       int err;
-
-       err = can_proto_unregister(&bcm_can_proto);
-       WARN_ON(err < 0);
+       can_proto_unregister(&bcm_can_proto);
 
        if (proc_dir)
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
index 21f5d244b8c37a44a252ab5c3230c5799e0eafe6..fe88a2d3067f8dc031888c74703f25897ac6d108 100644 (file)
@@ -825,17 +825,14 @@ static __init int raw_module_init(void)
 
        err = can_proto_register(&raw_can_proto);
        if (err < 0)
-               printk("can: registration of raw protocol failed\n");
+               printk(KERN_ERR "can: registration of raw protocol failed\n");
 
        return err;
 }
 
 static __exit void raw_module_exit(void)
 {
-       int err;
-
-       err = can_proto_unregister(&raw_can_proto);
-       WARN_ON(err < 0);
+       can_proto_unregister(&raw_can_proto);
 }
 
 module_init(raw_module_init);