summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-07-21 22:31:48 +0200
committerDavid S. Miller <davem@davemloft.net>2008-07-21 22:31:48 +0200
commit6579e57b31d79d31d9b806e41ba48774e73257dc (patch)
tree03ba72024a1982ee76b8a891a443b0fdfb6d7c93 /net/core
parentnet: use kcalloc in netdev_queue alloc (diff)
downloadlinux-6579e57b31d79d31d9b806e41ba48774e73257dc.tar.xz
linux-6579e57b31d79d31d9b806e41ba48774e73257dc.zip
net: Print the module name as part of the watchdog message
As suggested by Dave: This patch adds a function to get the driver name from a struct net_device, and consequently uses this in the watchdog timeout handler to print as part of the message. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 1698b3998981..ad5598d2bb37 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4686,6 +4686,26 @@ err_name:
return -ENOMEM;
}
+char *netdev_drivername(struct net_device *dev, char *buffer, int len)
+{
+ struct device_driver *driver;
+ struct device *parent;
+
+ if (len <= 0 || !buffer)
+ return buffer;
+ buffer[0] = 0;
+
+ parent = dev->dev.parent;
+
+ if (!parent)
+ return buffer;
+
+ driver = parent->driver;
+ if (driver && driver->name)
+ strlcpy(buffer, driver->name, len);
+ return buffer;
+}
+
static void __net_exit netdev_exit(struct net *net)
{
kfree(net->dev_name_head);