summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
authorKonrad Dybcio <konrad.dybcio@oss.qualcomm.com>2026-05-21 12:40:00 +0200
committerMika Westerberg <mika.westerberg@linux.intel.com>2026-05-21 14:29:05 +0200
commit8c3ff7c5ae15cc71000f10f4d0f26669b9471faa (patch)
tree7dab44925bd2e006424c45577d97af6e6379c126 /drivers/thunderbolt/switch.c
parente24f3c0df48378214d9a67c5048d0faca144b163 (diff)
downloadlinux-next-8c3ff7c5ae15cc71000f10f4d0f26669b9471faa.tar.gz
linux-next-8c3ff7c5ae15cc71000f10f4d0f26669b9471faa.zip
thunderbolt: Move pci_device out of tb_nhi
Not all USB4/TB implementations are based on a PCIe-attached controller. In order to make way for these, start off with moving the pci_device reference out of the main tb_nhi structure. Encapsulate the existing struct in a new tb_nhi_pci, that shall also house all properties that relate to the parent bus. Similarly, any other type of controller will be expected to contain tb_nhi as a member. Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
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);
}