From 46c1d49330fe21b3f9d2f7577ee4268248e7b666 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Wed, 19 Jul 2017 21:51:11 +0800 Subject: 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 --- include/usb.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/usb.h b/include/usb.h index a2666776771..64dfa84a9be 100644 --- a/include/usb.h +++ b/include/usb.h @@ -775,6 +775,14 @@ struct usb_device *usb_get_dev_index(struct udevice *bus, int index); 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 * -- cgit v1.3.1