Improved generic driver error messages.
authorFlorian Pose <fp@igh-essen.com>
Wed, 14 Dec 2011 16:47:28 +0100
changeset 2226 4d99b3e86d29
parent 2213 be3291de22e3
child 2227 b457bb3ef876
Improved generic driver error messages.
devices/generic.c
--- a/devices/generic.c	Mon Jan 09 12:01:22 2012 +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;