xhci: dbc: Add device pointer to dbc structure
authorMathias Nyman <mathias.nyman@linux.intel.com>
Thu, 23 Jul 2020 14:45:10 +0000 (17:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jul 2020 15:05:26 +0000 (17:05 +0200)
Currently the dbc structure contains a pointer to struct xhci_hcd,
and dbc functions use that to dig up the underlying device pointer.

We are trying to decouple xhci and dbc code, and prepare for
code that use dbc such as dbctty into into real device drivers.
This is one step along the way.

Keep functionality the same and keep the xhci pointer, and
let the new device pointer point to the xhci device for now.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200723144530.9992-8-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-dbgcap.c
drivers/usb/host/xhci-dbgcap.h

index 5bec36ed97c60ceba678e02d615e3cda9c01055b..ae584d6ae10c83490cbb96f7491cdb04e61a2fb9 100644 (file)
@@ -878,6 +878,7 @@ static int xhci_do_dbc_init(struct xhci_hcd *xhci)
        spin_unlock_irqrestore(&xhci->lock, flags);
 
        dbc->xhci = xhci;
+       dbc->dev = xhci_to_hcd(xhci)->self.sysdev;
        INIT_DELAYED_WORK(&dbc->event_work, xhci_dbc_handle_events);
        spin_lock_init(&dbc->lock);
 
index ce0c6072bd48870a0f6ed86e924dc7a2237d3bb9..7ca2f4ccc5376e5ccc2fe2e4de51a12c8c42fb99 100644 (file)
@@ -133,6 +133,7 @@ struct dbc_port {
 
 struct xhci_dbc {
        spinlock_t                      lock;           /* device access */
+       struct device                   *dev;
        struct xhci_hcd                 *xhci;
        struct dbc_regs __iomem         *regs;
        struct xhci_ring                *ring_evt;