]> git.sur5r.net Git - u-boot/commitdiff
dm: usb: xhci: Use explicit parameters for xhci_alloc_virt_device()
authorSimon Glass <sjg@chromium.org>
Wed, 25 Mar 2015 18:22:50 +0000 (12:22 -0600)
committerSimon Glass <sjg@chromium.org>
Sat, 18 Apr 2015 17:11:28 +0000 (11:11 -0600)
This function should not be delving into struct usb_device. Pass in the
parameters it needs directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h

index 10f11cd5472a6026dccbc7c764ac1720420b6a6e..2ac5016f5a17772a829ebe9e76791d50e4b653aa 100644 (file)
@@ -352,12 +352,10 @@ static struct xhci_container_ctx
  * @param udev pointer to USB deivce structure
  * @return 0 on success else -1 on failure
  */
-int xhci_alloc_virt_device(struct usb_device *udev)
+int xhci_alloc_virt_device(struct xhci_ctrl *ctrl, unsigned int slot_id)
 {
        u64 byte_64 = 0;
-       unsigned int slot_id = udev->slot_id;
        struct xhci_virt_device *virt_dev;
-       struct xhci_ctrl *ctrl = udev->controller;
 
        /* Slot ID 0 is reserved */
        if (ctrl->devs[slot_id]) {
index 61a4a36dad6c3163586c82fbe5cf7d482d826c7e..b4208a147f746ed4787eaf7b44708dae6a982155 100644 (file)
@@ -491,7 +491,7 @@ int usb_alloc_device(struct usb_device *udev)
 
        xhci_acknowledge_event(ctrl);
 
-       ret = xhci_alloc_virt_device(udev);
+       ret = xhci_alloc_virt_device(ctrl, udev->slot_id);
        if (ret < 0) {
                /*
                 * TODO: Unsuccessful Address Device command shall leave
index 1f489332b78f033aeb2f492b6f280eb17e08a496..1dde80409e49c757b910b248dd8e22e45a827a19 100644 (file)
@@ -1255,7 +1255,7 @@ void xhci_flush_cache(uintptr_t addr, u32 type_len);
 void xhci_inval_cache(uintptr_t addr, u32 type_len);
 void xhci_cleanup(struct xhci_ctrl *ctrl);
 struct xhci_ring *xhci_ring_alloc(unsigned int num_segs, bool link_trbs);
-int xhci_alloc_virt_device(struct usb_device *udev);
+int xhci_alloc_virt_device(struct xhci_ctrl *ctrl, unsigned int slot_id);
 int xhci_mem_init(struct xhci_ctrl *ctrl, struct xhci_hccr *hccr,
                  struct xhci_hcor *hcor);