net-sysfs: use to_net_dev in net_namespace()

Use to_net_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Geliang Tang 2015-12-22 23:11:49 +08:00 committed by David S. Miller
parent d317aa5893
commit 5c29482dd1
1 changed files with 2 additions and 2 deletions

View File

@ -1453,8 +1453,8 @@ static void netdev_release(struct device *d)
static const void *net_namespace(struct device *d)
{
struct net_device *dev;
dev = container_of(d, struct net_device, dev);
struct net_device *dev = to_net_dev(d);
return dev_net(dev);
}