Shift the definition of netpoll_cleanup() from netpoll core to the netconsole driver, updating all relevant file references. This change centralizes cleanup logic alongside netconsole target management, Given netpoll_cleanup() is only called by netconsole, keep it there. Signed-off-by: Breno Leitao --- drivers/net/netconsole.c | 10 ++++++++++ include/linux/netpoll.h | 1 - net/core/netpoll.c | 10 ---------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 30731711571be..90e359b87469a 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -260,6 +260,16 @@ static struct netconsole_target *alloc_and_init(void) return nt; } +static void netpoll_cleanup(struct netpoll *np) +{ + rtnl_lock(); + if (!np->dev) + goto out; + do_netpoll_cleanup(np); +out: + rtnl_unlock(); +} + /* Clean up every target in the cleanup_list and move the clean targets back to * the main target_list. */ diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 481ec474fa6b9..65bfade025f09 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -72,7 +72,6 @@ int netpoll_send_udp(struct netpoll *np, const char *msg, int len); int __netpoll_setup(struct netpoll *np, struct net_device *ndev); int netpoll_setup(struct netpoll *np); void __netpoll_free(struct netpoll *np); -void netpoll_cleanup(struct netpoll *np); void do_netpoll_cleanup(struct netpoll *np); netdev_tx_t netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); struct sk_buff *find_skb(struct netpoll *np, int len, int reserve); diff --git a/net/core/netpoll.c b/net/core/netpoll.c index b4634e91568e8..9e12a667a5f0a 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -703,13 +703,3 @@ void do_netpoll_cleanup(struct netpoll *np) } EXPORT_SYMBOL(do_netpoll_cleanup); -void netpoll_cleanup(struct netpoll *np) -{ - rtnl_lock(); - if (!np->dev) - goto out; - do_netpoll_cleanup(np); -out: - rtnl_unlock(); -} -EXPORT_SYMBOL(netpoll_cleanup); -- 2.47.3