[PATCH] usb: xhci: Fix the patch inherit dma configuration from parent dev

From: Sriram Dash
Date: Wed Sep 21 2016 - 02:09:30 EST


Fixes the patch https://patchwork.kernel.org/patch/9319527/
("usb: dwc3: host: inherit dma configuration from parent dev").

Signed-off-by: Sriram Dash <sriram.dash@xxxxxxx>
---
drivers/usb/host/xhci-mem.c | 12 ++++++------
drivers/usb/host/xhci.c | 20 ++++++++++----------
2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 6afe323..79608df 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -586,7 +586,7 @@ static void xhci_free_stream_ctx(struct xhci_hcd *xhci,
unsigned int num_stream_ctxs,
struct xhci_stream_ctx *stream_ctx, dma_addr_t dma)
{
- struct device *dev =3D xhci_to_hcd(xhci)->self.controller;
+ struct device *dev =3D xhci_to_hcd(xhci)->self.sysdev;
size_t size =3D sizeof(struct xhci_stream_ctx) * num_stream_ctxs;
=20
if (size > MEDIUM_STREAM_ARRAY_SIZE)
@@ -614,7 +614,7 @@ static struct xhci_stream_ctx *xhci_alloc_stream_ctx(st=
ruct xhci_hcd *xhci,
unsigned int num_stream_ctxs, dma_addr_t *dma,
gfp_t mem_flags)
{
- struct device *dev =3D xhci_to_hcd(xhci)->self.controller;
+ struct device *dev =3D xhci_to_hcd(xhci)->self.sysdev;
size_t size =3D sizeof(struct xhci_stream_ctx) * num_stream_ctxs;
=20
if (size > MEDIUM_STREAM_ARRAY_SIZE)
@@ -1644,7 +1644,7 @@ void xhci_slot_copy(struct xhci_hcd *xhci,
static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags)
{
int i;
- struct device *dev =3D xhci_to_hcd(xhci)->self.controller;
+ struct device *dev =3D xhci_to_hcd(xhci)->self.sysdev;
int num_sp =3D HCS_MAX_SCRATCHPAD(xhci->hcs_params2);
=20
xhci_dbg_trace(xhci, trace_xhci_dbg_init,
@@ -1716,7 +1716,7 @@ static void scratchpad_free(struct xhci_hcd *xhci)
{
int num_sp;
int i;
- struct device *dev =3D xhci_to_hcd(xhci)->self.controller;
+ struct device *dev =3D xhci_to_hcd(xhci)->self.sysdev;
=20
if (!xhci->scratchpad)
return;
@@ -1792,7 +1792,7 @@ void xhci_free_command(struct xhci_hcd *xhci,
=20
void xhci_mem_cleanup(struct xhci_hcd *xhci)
{
- struct device *dev =3D xhci_to_hcd(xhci)->self.controller;
+ struct device *dev =3D xhci_to_hcd(xhci)->self.sysdev;
int size;
int i, j, num_ports;
=20
@@ -2334,7 +2334,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xh=
ci, gfp_t flags)
int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
{
dma_addr_t dma;
- struct device *dev =3D xhci_to_hcd(xhci)->self.controller;
+ struct device *dev =3D xhci_to_hcd(xhci)->self.sysdev;
unsigned int val, val2;
u64 val_64;
struct xhci_segment *seg;
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 01d96c9..9a1ff09 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -231,7 +231,7 @@ static int xhci_free_msi(struct xhci_hcd *xhci)
static int xhci_setup_msi(struct xhci_hcd *xhci)
{
int ret;
- struct pci_dev *pdev =3D to_pci_dev(xhci_to_hcd(xhci)->self.controller);
+ struct pci_dev *pdev =3D to_pci_dev(xhci_to_hcd(xhci)->self.sysdev);
=20
ret =3D pci_enable_msi(pdev);
if (ret) {
@@ -257,7 +257,7 @@ static int xhci_setup_msi(struct xhci_hcd *xhci)
*/
static void xhci_free_irq(struct xhci_hcd *xhci)
{
- struct pci_dev *pdev =3D to_pci_dev(xhci_to_hcd(xhci)->self.controller);
+ struct pci_dev *pdev =3D to_pci_dev(xhci_to_hcd(xhci)->self.sysdev);
int ret;
=20
/* return if using legacy interrupt */
@@ -280,7 +280,7 @@ static int xhci_setup_msix(struct xhci_hcd *xhci)
{
int i, ret =3D 0;
struct usb_hcd *hcd =3D xhci_to_hcd(xhci);
- struct pci_dev *pdev =3D to_pci_dev(hcd->self.controller);
+ struct pci_dev *pdev =3D to_pci_dev(hcd->self.sysdev);
=20
/*
* calculate number of msi-x vectors supported.
@@ -337,7 +337,7 @@ free_entries:
static void xhci_cleanup_msix(struct xhci_hcd *xhci)
{
struct usb_hcd *hcd =3D xhci_to_hcd(xhci);
- struct pci_dev *pdev =3D to_pci_dev(hcd->self.controller);
+ struct pci_dev *pdev =3D to_pci_dev(hcd->self.sysdev);
=20
if (xhci->quirks & XHCI_PLAT)
return;
@@ -376,7 +376,7 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
if (xhci->quirks & XHCI_PLAT)
return 0;
=20
- pdev =3D to_pci_dev(xhci_to_hcd(xhci)->self.controller);
+ pdev =3D to_pci_dev(xhci_to_hcd(xhci)->self.sysdev);
/*
* Some Fresco Logic host controllers advertise MSI, but fail to
* generate interrupts. Don't even try to enable MSI.
@@ -745,7 +745,7 @@ void xhci_shutdown(struct usb_hcd *hcd)
struct xhci_hcd *xhci =3D hcd_to_xhci(hcd);
=20
if (xhci->quirks & XHCI_SPURIOUS_REBOOT)
- usb_disable_xhci_ports(to_pci_dev(hcd->self.controller));
+ usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev));
=20
spin_lock_irq(&xhci->lock);
xhci_halt(xhci);
@@ -762,7 +762,7 @@ void xhci_shutdown(struct usb_hcd *hcd)
=20
/* Yet another workaround for spurious wakeups at shutdown with HSW */
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
- pci_set_power_state(to_pci_dev(hcd->self.controller), PCI_D3hot);
+ pci_set_power_state(to_pci_dev(hcd->self.sysdev), PCI_D3hot);
}
=20
#ifdef CONFIG_PM
@@ -3605,7 +3605,7 @@ void xhci_free_dev(struct usb_hcd *hcd, struct usb_de=
vice *udev)
* if no devices remain.
*/
if (xhci->quirks & XHCI_RESET_ON_RESUME)
- pm_runtime_put_noidle(hcd->self.controller);
+ pm_runtime_put_noidle(hcd->self.sysdev);
#endif
=20
ret =3D xhci_check_args(hcd, udev, NULL, 0, true, __func__);
@@ -3745,7 +3745,7 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_de=
vice *udev)
* suspend if there is a device attached.
*/
if (xhci->quirks & XHCI_RESET_ON_RESUME)
- pm_runtime_get_noresume(hcd->self.controller);
+ pm_runtime_get_noresume(hcd->self.sysdev);
#endif
=20
=20
@@ -4834,7 +4834,7 @@ int xhci_get_frame(struct usb_hcd *hcd)
int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
{
struct xhci_hcd *xhci;
- struct device *dev =3D hcd->self.controller;
+ struct device *dev =3D hcd->self.sysdev;
int retval;
=20
/* Accept arbitrarily long scatter-gather lists */
--=20
2.1.0

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

>I think I also had some minimal changes that I did myself in order to fix =
a build
>regression I introduced.
>
> Arnd