summaryrefslogtreecommitdiffstats
path: root/drivers/net/macb.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-11-02 08:00:51 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-11-02 08:26:24 +0100
commit9092c2ea40632453ed34442605c85b4618d60761 (patch)
tree34ddc74b0a35071a40c39d2b3b5bc8ca6b45b2d6 /drivers/net/macb.c
parenta68d4847bc27c7c50100308d6557330904ba096d (diff)
downloadbarebox-9092c2ea40632453ed34442605c85b4618d60761.tar.gz
barebox-9092c2ea40632453ed34442605c85b4618d60761.tar.xz
net: macb: add remove callback
The macb driver does DMA and thus should be quiesced on shutdown. Add the remove callback. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r--drivers/net/macb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index fe192f9bf4..b2957b7d29 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -719,6 +719,13 @@ static int macb_probe(struct device_d *dev)
return 0;
}
+static void macb_remove(struct device_d *dev)
+{
+ struct macb_device *macb = dev->priv;
+
+ macb_halt(&macb->netdev);
+}
+
static const struct of_device_id macb_dt_ids[] = {
{ .compatible = "cdns,at91sam9260-macb",},
{ /* sentinel */ }
@@ -727,6 +734,7 @@ static const struct of_device_id macb_dt_ids[] = {
static struct driver_d macb_driver = {
.name = "macb",
.probe = macb_probe,
+ .remove = macb_remove,
.of_compatible = DRV_OF_COMPAT(macb_dt_ids),
};
device_platform_driver(macb_driver);