Improved generic driver error messages. redundancy
authorFlorian Pose <fp@igh-essen.com>
Wed, 14 Dec 2011 16:47:28 +0100
branchredundancy
changeset 2302 4ef148157381
parent 2301 01e4381ebd09
child 2303 f056e31f1a28
Improved generic driver error messages.
devices/generic.c
--- a/devices/generic.c	Fri Dec 09 10:35:23 2011 +0100
+++ b/devices/generic.c	Wed Dec 14 16:47:28 2011 +0100
@@ -207,9 +207,10 @@
         return -ENOMEM;
     }
 
-    ret = sock_create_kern(PF_PACKET, SOCK_RAW, htons(ETH_P_ETHERCAT), &dev->socket);
+    ret = sock_create_kern(PF_PACKET, SOCK_RAW, htons(ETH_P_ETHERCAT),
+            &dev->socket);
     if (ret) {
-        printk(KERN_ERR PFX "Failed to create socket.\n");
+        printk(KERN_ERR PFX "Failed to create socket (ret = %i).\n", ret);
         return ret;
     }
 
@@ -222,7 +223,8 @@
     sa.sll_ifindex = desc->ifindex;
     ret = kernel_bind(dev->socket, (struct sockaddr *) &sa, sizeof(sa));
     if (ret) {
-        printk(KERN_ERR PFX "Failed to bind() socket to interface.\n");
+        printk(KERN_ERR PFX "Failed to bind() socket to interface"
+                " (ret = %i).\n", ret);
         sock_release(dev->socket);
         dev->socket = NULL;
         return ret;