summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-10-26 10:50:19 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-10-29 11:26:35 +0100
commit610a2b2b696268f00d798e68db51a2cf90642648 (patch)
tree80ed80e572670a351a5e13c764e2d0b3ea9ffcec /include
parente3eb0c729bc2e3dac0e0dfb0a04be40bfcffcf1c (diff)
downloadbarebox-610a2b2b696268f00d798e68db51a2cf90642648.tar.gz
barebox-610a2b2b696268f00d798e68db51a2cf90642648.tar.xz
usb: host: ehci: do not use dev->priv
An ehci can be registered with ehci_register which is passed a struct device_d *. In that case the priv pointer may already be used by the caller, so we must not use it in the ehci code. At least for the Atmel ehci driver this fixes a bug, here dev->priv is set two times to different values. Since we need dev->priv in the ehci code to get the controller in ehci_detect() we can no longer implement that without the help of the caller, hence we eport ehci_detect() and epect it to be called by the code which registers a ehci host. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/usb/ehci.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/usb/ehci.h b/include/usb/ehci.h
index 327500d49a..9ca9252eb1 100644
--- a/include/usb/ehci.h
+++ b/include/usb/ehci.h
@@ -24,6 +24,7 @@ struct ehci_host;
#ifdef CONFIG_USB_EHCI
struct ehci_host *ehci_register(struct device_d *dev, struct ehci_data *data);
void ehci_unregister(struct ehci_host *);
+int ehci_detect(struct ehci_host *ehci);
#else
static inline struct ehci_host *ehci_register(struct device_d *dev,
struct ehci_data *data)
@@ -34,6 +35,11 @@ static inline struct ehci_host *ehci_register(struct device_d *dev,
static inline void ehci_unregister(struct ehci_host *ehci)
{
}
+
+static inline int ehci_detect(struct ehci_host *ehci)
+{
+ return 0;
+}
#endif
#endif /* __USB_EHCI_H */