Output device name in link change message; fixed null-pointer protections. redundancy
authorFlorian Pose <fp@igh-essen.com>
Wed, 09 Nov 2011 17:07:33 +0100
branchredundancy
changeset 2160 e3bf5adad75f
parent 2159 72ac85ee3729
child 2267 2d36f36a433c
Output device name in link change message; fixed null-pointer protections.
master/device.c
--- a/master/device.c	Wed Nov 09 17:06:04 2011 +0100
+++ b/master/device.c	Wed Nov 09 17:07:33 2011 +0100
@@ -640,14 +640,15 @@
         )
 {
     if (unlikely(!device)) {
-        EC_MASTER_WARN(device->master, "ecdev_set_link(): No device!\n");
+        EC_WARN("ecdev_set_link() called with null device!\n");
         return;
     }
 
     if (likely(state != device->link_state)) {
         device->link_state = state;
         EC_MASTER_INFO(device->master,
-                "Link state changed to %s.\n", (state ? "UP" : "DOWN"));
+                "Link state of %s changed to %s.\n",
+                device->dev->name, (state ? "UP" : "DOWN"));
     }
 }
 
@@ -662,7 +663,7 @@
         )
 {
     if (unlikely(!device)) {
-        EC_MASTER_WARN(device->master, "ecdev_get_link(): No device!\n");
+        EC_WARN("ecdev_get_link() called with null device!\n");
         return 0;
     }