Output device name in link change message; fixed null-pointer protections.
--- 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;
}