[PATCH 09/13] ehci: add remove function

Michael Grzeschik m.grzeschik at pengutronix.de
Wed Aug 4 05:59:13 EDT 2010


and stop the ehci controller before the kernel is trying to restart it.

Signed-off-by: Michael Grzeschik <m.grzeschik at pengutronix.de>
---
 drivers/usb/host/ehci-hcd.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 1c266f3..802c548 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -898,6 +898,7 @@ static int ehci_probe(struct device_d *dev)
 
 	ehci = xmalloc(sizeof(struct ehci_priv));
 	host = &ehci->host;
+	dev->priv = ehci;
 
 	if (pdata) {
 		ehci->flags = pdata->flags;
@@ -926,9 +927,16 @@ static int ehci_probe(struct device_d *dev)
 	return 0;
 }
 
+static void ehci_remove(struct device_d *dev)
+{
+	struct ehci_priv *ehci = dev->priv;
+	ehci_halt(ehci);
+}
+
 static struct driver_d ehci_driver = {
 	.name  = "ehci",
 	.probe = ehci_probe,
+	.remove = ehci_remove,
 };
 
 static int ehcil_init(void)
-- 
1.7.1




More information about the barebox mailing list