From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 4/4] net: macb: add remove callback
Date: Fri, 2 Nov 2018 08:26:32 +0100 [thread overview]
Message-ID: <20181102072632.10654-4-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20181102072632.10654-1-s.hauer@pengutronix.de>
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>
---
drivers/net/macb.c | 8 ++++++++
1 file changed, 8 insertions(+)
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);
--
2.19.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2018-11-02 7:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-02 7:26 [PATCH 1/4] net: macb: no need for coherent memory for receive buffer Sascha Hauer
2018-11-02 7:26 ` [PATCH 2/4] net: macb: remove unused variable Sascha Hauer
2018-11-02 7:26 ` [PATCH 3/4] net: macb: simplify private data allocation Sascha Hauer
2018-11-02 7:26 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181102072632.10654-4-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox