Skip to content

Commit 7c6ca16

Browse files
LKomaryanskiylorc
authored andcommitted
net: renesas: rswitch: add missing routines in remove and fix deinit ordering
This patch adds missing unregister functions in driver remove callback, such as unregister_pernet_subsys and unregister_netevent_notifier. Also, corrected sequence of deinitialization - it should be executed in reverse order related to initialization. Reviewed-by: Dmytro Firsov <[email protected]> Acked-by: Volodymyr Babchuk <[email protected]> Signed-off-by: Leonid Komarianskyi <[email protected]>
1 parent a7fbe35 commit 7c6ca16

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

drivers/net/ethernet/renesas/rswitch.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4389,19 +4389,20 @@ static int renesas_eth_sw_remove(struct platform_device *pdev)
43894389
struct rswitch_private *priv = platform_get_drvdata(pdev);
43904390

43914391
if (!parallel_mode) {
4392+
unregister_fib_notifier(&init_net, &priv->fib_nb);
4393+
destroy_workqueue(priv->rswitch_fib_wq);
4394+
unregister_netevent_notifier(&netevent_notifier);
4395+
destroy_workqueue(priv->rswitch_netevent_wq);
4396+
unregister_netdevice_notifier(&vlan_notifier_block);
4397+
destroy_workqueue(priv->rswitch_forward_wq);
4398+
unregister_pernet_subsys(&rswitch_net_ops);
43924399
/* Disable R-Switch clock */
43934400
rs_write32(RCDC_RCD, priv->addr + RCDC);
43944401
rswitch_deinit(priv);
43954402

43964403
pm_runtime_put(&pdev->dev);
43974404
pm_runtime_disable(&pdev->dev);
43984405
clk_disable(priv->phy_clk);
4399-
4400-
unregister_netdevice_notifier(&vlan_notifier_block);
4401-
unregister_fib_notifier(&init_net, &priv->fib_nb);
4402-
destroy_workqueue(priv->rswitch_fib_wq);
4403-
destroy_workqueue(priv->rswitch_netevent_wq);
4404-
destroy_workqueue(priv->rswitch_forward_wq);
44054406
}
44064407

44074408
rswitch_desc_free(priv);

0 commit comments

Comments
 (0)