[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 07 Jul 2008 09:51:30 +0800
From: Wang Chen <wangchen@...fujitsu.com>
To: Arjan van de Ven <arjan@...radead.org>
CC: David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: Printing the driver name as part of the netdev watchdog message
Arjan van de Ven said the following on 2008-7-7 7:56:
> +void netdev_drivername(struct net_device *dev, char *buffer, int len)
> +{
> + struct device_driver *driver;
> + struct device *parent;
> + struct ethtool_drvinfo info;
> + const struct ethtool_ops *ops = dev->ethtool_ops;
> +
> + if (len <= 0)
> + return;
> + buffer[0] = 0;
> +
> + if (ops->get_drvinfo) {
if (ops && ops->get_drvinfo)
> + memset(&info, 0, sizeof(info));
> + info.cmd = ETHTOOL_GDRVINFO;
> + ops->get_drvinfo(dev, &info);
> + strlcpy(buffer, info.driver, len);
> + if (strlen(info.driver) > 0)
> + return;
> + }
seems the logic should be:
if (strlen(info.driver) > 0) {
strlcpy(buffer, info.driver, len);
return;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists