diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2017-07-19 21:51:11 +0800 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2017-07-28 23:34:30 +0200 |
commit | 46c1d49330fe21b3f9d2f7577ee4268248e7b666 (patch) | |
tree | 68584c48afb9880819e0b16eb985f047ce047092 /include/usb.h | |
parent | a199a7244899f6385035459cbc62409bd9bbcc23 (diff) |
usb: hub: Add a new API to test if a hub device is root hub
Sometimes we need know if a given hub device is root hub or not.
Add a new API to test this. This removes the xHCI driver's own
version is_root_hub() and change to use the new API.
While we are here, remove the unused/commented out get_usb_device()
in the xHCI driver too.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/usb.h')
-rw-r--r-- | include/usb.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/usb.h b/include/usb.h index a266677677..64dfa84a9b 100644 --- a/include/usb.h +++ b/include/usb.h @@ -776,6 +776,14 @@ int usb_setup_device(struct usb_device *dev, bool do_read, struct usb_device *parent); /** + * usb_hub_is_root_hub() - Test whether a hub device is root hub or not + * + * @hub: USB hub device to test + * @return: true if the hub device is root hub, false otherwise. + */ +bool usb_hub_is_root_hub(struct udevice *hub); + +/** * usb_hub_scan() - Scan a hub and find its devices * * @hub: Hub device to scan |