mirror of
https://git.yoctoproject.org/meta-ti
synced 2026-07-16 22:38:04 +00:00
2177f80076
Duplicate patches between PSP and 3.2.17 have been dropped from the 3.2.17 series Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
56 lines
1.8 KiB
Diff
56 lines
1.8 KiB
Diff
From ee79f6838bd3f230ebf00849029dac3b9be112e5 Mon Sep 17 00:00:00 2001
|
|
From: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
|
|
Date: Sun, 15 Apr 2012 13:26:01 +0000
|
|
Subject: [PATCH 079/165] dummy: Add ndo_uninit().
|
|
|
|
commit 890fdf2a0cb88202d1427589db2cf29c1bdd3c1d upstream.
|
|
|
|
In register_netdevice(), when ndo_init() is successful and later
|
|
some error occurred, ndo_uninit() will be called.
|
|
So dummy deivce is desirable to implement ndo_uninit() method
|
|
to free percpu stats for this case.
|
|
And, ndo_uninit() is also called along with dev->destructor() when
|
|
device is unregistered, so in order to prevent dev->dstats from
|
|
being freed twice, dev->destructor is modified to free_netdev().
|
|
|
|
Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|
---
|
|
drivers/net/dummy.c | 6 +++---
|
|
1 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
|
|
index a7c5e88..eeac9ca 100644
|
|
--- a/drivers/net/dummy.c
|
|
+++ b/drivers/net/dummy.c
|
|
@@ -106,14 +106,14 @@ static int dummy_dev_init(struct net_device *dev)
|
|
return 0;
|
|
}
|
|
|
|
-static void dummy_dev_free(struct net_device *dev)
|
|
+static void dummy_dev_uninit(struct net_device *dev)
|
|
{
|
|
free_percpu(dev->dstats);
|
|
- free_netdev(dev);
|
|
}
|
|
|
|
static const struct net_device_ops dummy_netdev_ops = {
|
|
.ndo_init = dummy_dev_init,
|
|
+ .ndo_uninit = dummy_dev_uninit,
|
|
.ndo_start_xmit = dummy_xmit,
|
|
.ndo_validate_addr = eth_validate_addr,
|
|
.ndo_set_rx_mode = set_multicast_list,
|
|
@@ -127,7 +127,7 @@ static void dummy_setup(struct net_device *dev)
|
|
|
|
/* Initialize the device structure. */
|
|
dev->netdev_ops = &dummy_netdev_ops;
|
|
- dev->destructor = dummy_dev_free;
|
|
+ dev->destructor = free_netdev;
|
|
|
|
/* Fill in device structure with ethernet-generic values. */
|
|
dev->tx_queue_len = 0;
|
|
--
|
|
1.7.7.6
|
|
|