summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r--drivers/thunderbolt/switch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index d7c53eb3221b..769b57ff276b 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -211,6 +211,7 @@ static int nvm_authenticate_device_dma_port(struct tb_switch *sw)
static void nvm_authenticate_start_dma_port(struct tb_switch *sw)
{
+ struct pci_dev *pdev = to_pci_dev(sw->tb->nhi->dev);
struct pci_dev *root_port;
/*
@@ -219,16 +220,17 @@ static void nvm_authenticate_start_dma_port(struct tb_switch *sw)
* itself. To be on the safe side keep the root port in D0 during
* the whole upgrade process.
*/
- root_port = pcie_find_root_port(sw->tb->nhi->pdev);
+ root_port = pcie_find_root_port(pdev);
if (root_port)
pm_runtime_get_noresume(&root_port->dev);
}
static void nvm_authenticate_complete_dma_port(struct tb_switch *sw)
{
+ struct pci_dev *pdev = to_pci_dev(sw->tb->nhi->dev);
struct pci_dev *root_port;
- root_port = pcie_find_root_port(sw->tb->nhi->pdev);
+ root_port = pcie_find_root_port(pdev);
if (root_port)
pm_runtime_put(&root_port->dev);
}