diff options
-rw-r--r-- | drivers/net/veth.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 75b40fefc4ee..4f93a55aaaa5 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -262,16 +262,20 @@ static void veth_dev_free(struct net_device *dev) | |||
262 | free_netdev(dev); | 262 | free_netdev(dev); |
263 | } | 263 | } |
264 | 264 | ||
265 | static const struct net_device_ops veth_netdev_ops = { | ||
266 | .ndo_init = veth_dev_init, | ||
267 | .ndo_open = veth_open, | ||
268 | .ndo_get_stats = veth_get_stats, | ||
269 | }; | ||
270 | |||
265 | static void veth_setup(struct net_device *dev) | 271 | static void veth_setup(struct net_device *dev) |
266 | { | 272 | { |
267 | ether_setup(dev); | 273 | ether_setup(dev); |
268 | 274 | ||
275 | dev->netdev_ops = &veth_netdev_ops; | ||
269 | dev->hard_start_xmit = veth_xmit; | 276 | dev->hard_start_xmit = veth_xmit; |
270 | dev->get_stats = veth_get_stats; | ||
271 | dev->open = veth_open; | ||
272 | dev->ethtool_ops = &veth_ethtool_ops; | 277 | dev->ethtool_ops = &veth_ethtool_ops; |
273 | dev->features |= NETIF_F_LLTX; | 278 | dev->features |= NETIF_F_LLTX; |
274 | dev->init = veth_dev_init; | ||
275 | dev->destructor = veth_dev_free; | 279 | dev->destructor = veth_dev_free; |
276 | } | 280 | } |
277 | 281 | ||
@@ -297,7 +301,7 @@ static int veth_device_event(struct notifier_block *unused, | |||
297 | { | 301 | { |
298 | struct net_device *dev = ptr; | 302 | struct net_device *dev = ptr; |
299 | 303 | ||
300 | if (dev->open != veth_open) | 304 | if (dev->netdev_ops->ndo_open != veth_open) |
301 | goto out; | 305 | goto out; |
302 | 306 | ||
303 | switch (event) { | 307 | switch (event) { |