net: bcmgenet: Add a shutdown callback

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>
This commit is contained in:
Florian Fainelli 2019-10-15 10:36:24 -07:00 committed by David S. Miller
parent 554032cdfb
commit d9f45ab9e6
1 changed files with 6 additions and 0 deletions

View 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,