[usb] Avoid unnecessary calls to usb_hub_set_drvdata()
The driver-private data for root hubs is already set immediately after allocating the USB bus. There seems to be no reason to set it again when opening the root hub. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -2944,8 +2944,7 @@ static void xhci_hub_close ( struct usb_hub *hub __unused ) {
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int xhci_root_open ( struct usb_hub *hub ) {
|
||||
struct usb_bus *bus = hub->bus;
|
||||
struct xhci_device *xhci = usb_bus_get_hostdata ( bus );
|
||||
struct xhci_device *xhci = usb_hub_get_drvdata ( hub );
|
||||
struct usb_port *port;
|
||||
uint32_t portsc;
|
||||
unsigned int i;
|
||||
@@ -2982,9 +2981,6 @@ static int xhci_root_open ( struct usb_hub *hub ) {
|
||||
*/
|
||||
mdelay ( XHCI_LINK_STATE_DELAY_MS );
|
||||
|
||||
/* Record hub driver private data */
|
||||
usb_hub_set_drvdata ( hub, xhci );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2993,10 +2989,9 @@ static int xhci_root_open ( struct usb_hub *hub ) {
|
||||
*
|
||||
* @v hub USB hub
|
||||
*/
|
||||
static void xhci_root_close ( struct usb_hub *hub ) {
|
||||
static void xhci_root_close ( struct usb_hub *hub __unused ) {
|
||||
|
||||
/* Clear hub driver private data */
|
||||
usb_hub_set_drvdata ( hub, NULL );
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user