Re: Printing the driver name as part of the netdev watchdog message | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Kernel List] [Site Home] [Ethernet Bridging] [Git] [IETF Annouce] [Linux Assembly] [VLAN] [Networking] [Security] [Bugtraq] [Rubini] [Photo] [Yosemite] [MIPS Linux] [ARM Linux] [Linux Virtualization] [Linux Security] [Linux IDE] [Linux RAID] [Linux SCSI] [Linux Wireless] [DDR & Rambus] [Free Dating] [Linux Resources] [Wireless Reading Device]
![]() |
![]() |