summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-10-26 10:35:03 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-10-29 11:26:35 +0100
commite3eb0c729bc2e3dac0e0dfb0a04be40bfcffcf1c (patch)
tree982d039bf315bc0caeebefe01b515591c6096655 /include
parente44fddbd8965f40e09082763013da2957f8bc8e0 (diff)
downloadbarebox-e3eb0c729bc2e3dac0e0dfb0a04be40bfcffcf1c.tar.gz
barebox-e3eb0c729bc2e3dac0e0dfb0a04be40bfcffcf1c.tar.xz
usb: host: ehci: add ehci_unregister()
ehci_register() allocates data and registers a ehci host. Add ehci_unregister() to properly halt the controller and to free the memory again.. To do so, change ehci_register() to return the ehci host rather than an error code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/usb/ehci.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/usb/ehci.h b/include/usb/ehci.h
index 1008e92f02..327500d49a 100644
--- a/include/usb/ehci.h
+++ b/include/usb/ehci.h
@@ -19,12 +19,20 @@ struct ehci_data {
void *drvdata;
};
+struct ehci_host;
+
#ifdef CONFIG_USB_EHCI
-int ehci_register(struct device_d *dev, struct ehci_data *data);
+struct ehci_host *ehci_register(struct device_d *dev, struct ehci_data *data);
+void ehci_unregister(struct ehci_host *);
#else
-static inline int ehci_register(struct device_d *dev, struct ehci_data *data)
+static inline struct ehci_host *ehci_register(struct device_d *dev,
+ struct ehci_data *data)
+{
+ return ERR_PTR(-ENOSYS);
+}
+
+static inline void ehci_unregister(struct ehci_host *ehci)
{
- return -ENOSYS;
}
#endif