]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
Call request_module() only if CONFIG_KMOD is set.
authorthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 6 Feb 2008 23:18:14 +0000 (23:18 +0000)
committerthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 6 Feb 2008 23:18:14 +0000 (23:18 +0000)
git-svn-id: svn://svn.berlios.de//socketcan/trunk@678 030b6a49-0b11-0410-94ab-b0dab22257f2

kernel/2.6/net/can/af_can.c

index 149f7c695aac130b7131a5b525c953836ff31e12..fc621a8c969aca1cb6e8ac0e71e3ebaf5725a125 100644 (file)
@@ -159,6 +159,7 @@ static int can_create(struct socket *sock, int protocol)
                return -EAFNOSUPPORT;
 #endif
 
+#ifdef CONFIG_KMOD
        /* try to load protocol module, when CONFIG_KMOD is defined */
        if (!proto_tab[protocol]) {
                err = request_module("can-proto-%d", protocol);
@@ -168,16 +169,11 @@ static int can_create(struct socket *sock, int protocol)
                 * return the error code immediately.  Below we will
                 * return -EPROTONOSUPPORT
                 */
-               if (err == -ENOSYS) {
-                       if (printk_ratelimit())
-                               printk(KERN_INFO "can: request_module()"
-                                      " not implemented.\n");
-               } else if (err) {
-                       if (printk_ratelimit())
-                               printk(KERN_ERR "can: request_module "
-                                      "(can-proto-%d) failed.\n", protocol);
-               }
+               if (err && printk_ratelimit())
+                       printk(KERN_ERR "can: request_module "
+                              "(can-proto-%d) failed.\n", protocol);
        }
+#endif
 
        spin_lock(&proto_tab_lock);
        cp = proto_tab[protocol];