]> xenbits.xensource.com Git - seabios.git/commitdiff
usb: Remove usbdev->slotid field
authorKevin O'Connor <kevin@koconnor.net>
Tue, 5 Jan 2016 18:41:09 +0000 (13:41 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 7 Jan 2016 15:14:37 +0000 (10:14 -0500)
The usbdev->slotid field is xhci specific and on xhci it is always
reachable from usbdev->defpipe->slotid.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/hw/usb-xhci.c
src/hw/usb.h

index 3359cffd005962423789cb17aa84312ddf6b29b8..089cae75cbc25c12e11eb3b1b064da15b3e83257 100644 (file)
@@ -1006,9 +1006,11 @@ xhci_alloc_pipe(struct usbdevice_s *usbdev
             free(dev);
             goto fail;
         }
-        pipe->slotid = usbdev->slotid = slotid;
+        pipe->slotid = slotid;
     } else {
-        pipe->slotid = usbdev->slotid;
+        struct xhci_pipe *defpipe = container_of(
+            usbdev->defpipe, struct xhci_pipe, pipe);
+        pipe->slotid = defpipe->slotid;
         // Send configure command.
         int cc = xhci_cmd_configure_endpoint(xhci, pipe->slotid, in);
         if (cc != CC_SUCCESS) {
index efb5e6f9ccf44c7da9842254b2dff98338f0d4d5..94e12b20dd8bb9fb8893e3d1167eec559a673bed 100644 (file)
@@ -22,7 +22,6 @@ struct usb_pipe {
 struct usbdevice_s {
     struct usbhub_s *hub;
     struct usb_pipe *defpipe;
-    u32 slotid;
     u32 port;
     struct usb_config_descriptor *config;
     struct usb_interface_descriptor *iface;