diff options
Diffstat (limited to 'net/core/net-sysfs.c')
-rw-r--r-- | net/core/net-sysfs.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index b279077c3089..830f8a7c1cb1 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -31,7 +31,6 @@ | |||
31 | static const char fmt_hex[] = "%#x\n"; | 31 | static const char fmt_hex[] = "%#x\n"; |
32 | static const char fmt_long_hex[] = "%#lx\n"; | 32 | static const char fmt_long_hex[] = "%#lx\n"; |
33 | static const char fmt_dec[] = "%d\n"; | 33 | static const char fmt_dec[] = "%d\n"; |
34 | static const char fmt_udec[] = "%u\n"; | ||
35 | static const char fmt_ulong[] = "%lu\n"; | 34 | static const char fmt_ulong[] = "%lu\n"; |
36 | static const char fmt_u64[] = "%llu\n"; | 35 | static const char fmt_u64[] = "%llu\n"; |
37 | 36 | ||
@@ -202,7 +201,7 @@ static ssize_t speed_show(struct device *dev, | |||
202 | if (netif_running(netdev)) { | 201 | if (netif_running(netdev)) { |
203 | struct ethtool_cmd cmd; | 202 | struct ethtool_cmd cmd; |
204 | if (!__ethtool_get_settings(netdev, &cmd)) | 203 | if (!__ethtool_get_settings(netdev, &cmd)) |
205 | ret = sprintf(buf, fmt_udec, ethtool_cmd_speed(&cmd)); | 204 | ret = sprintf(buf, fmt_dec, ethtool_cmd_speed(&cmd)); |
206 | } | 205 | } |
207 | rtnl_unlock(); | 206 | rtnl_unlock(); |
208 | return ret; | 207 | return ret; |
@@ -1481,6 +1480,15 @@ static int of_dev_node_match(struct device *dev, const void *data) | |||
1481 | return ret == 0 ? dev->of_node == data : ret; | 1480 | return ret == 0 ? dev->of_node == data : ret; |
1482 | } | 1481 | } |
1483 | 1482 | ||
1483 | /* | ||
1484 | * of_find_net_device_by_node - lookup the net device for the device node | ||
1485 | * @np: OF device node | ||
1486 | * | ||
1487 | * Looks up the net_device structure corresponding with the device node. | ||
1488 | * If successful, returns a pointer to the net_device with the embedded | ||
1489 | * struct device refcount incremented by one, or NULL on failure. The | ||
1490 | * refcount must be dropped when done with the net_device. | ||
1491 | */ | ||
1484 | struct net_device *of_find_net_device_by_node(struct device_node *np) | 1492 | struct net_device *of_find_net_device_by_node(struct device_node *np) |
1485 | { | 1493 | { |
1486 | struct device *dev; | 1494 | struct device *dev; |