net: bcmgenet: Add a shutdown callback
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 15 Oct 2019 17:36:24 +0000 (10:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Oct 2019 03:59:28 +0000 (20:59 -0700)
Make sure that we completely quiesce the network device, including its
DMA to avoid having it continue to receive packets while there is no
software alive to service those.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Doug Berger <opendmb@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c

index dd4e4f1dd3842aef997cfd8b87d3bc58abc1cbfb..f10ffd35bc476f1af36011422a5874d31ed1d759 100644 (file)
@@ -3596,6 +3596,11 @@ static int bcmgenet_remove(struct platform_device *pdev)
        return 0;
 }
 
+static void bcmgenet_shutdown(struct platform_device *pdev)
+{
+       bcmgenet_remove(pdev);
+}
+
 #ifdef CONFIG_PM_SLEEP
 static int bcmgenet_resume(struct device *d)
 {
@@ -3714,6 +3719,7 @@ static SIMPLE_DEV_PM_OPS(bcmgenet_pm_ops, bcmgenet_suspend, bcmgenet_resume);
 static struct platform_driver bcmgenet_driver = {
        .probe  = bcmgenet_probe,
        .remove = bcmgenet_remove,
+       .shutdown = bcmgenet_shutdown,
        .driver = {
                .name   = "bcmgenet",
                .of_match_table = bcmgenet_match,