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>
This commit is contained in:
Arjan van de Ven
2008-07-21 13:31:48 -07:00
committed by David S. Miller
parent 7943986ca1
commit 6579e57b31
3 changed files with 25 additions and 3 deletions

View File

@@ -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);