Skip to content

Commit d332642

Browse files
fenghusthubjorn-helgaas
authored andcommitted
PCI: apple: Use pci_dev_id() to simplify the code
When we have a struct pci_dev *, use pci_dev_id() instead of manually composing the ID with PCI_DEVID() from dev->bus->number and dev->devfn. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20230807134858.116051-2-wangxiongfeng2@huawei.com Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent e3a3a09 commit d332642

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pci/controller/pcie-apple.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ static struct apple_pcie_port *apple_pcie_get_port(struct pci_dev *pdev)
670670
static int apple_pcie_add_device(struct apple_pcie_port *port,
671671
struct pci_dev *pdev)
672672
{
673-
u32 sid, rid = PCI_DEVID(pdev->bus->number, pdev->devfn);
673+
u32 sid, rid = pci_dev_id(pdev);
674674
int idx, err;
675675

676676
dev_dbg(&pdev->dev, "added to bus %s, index %d\n",
@@ -701,7 +701,7 @@ static int apple_pcie_add_device(struct apple_pcie_port *port,
701701
static void apple_pcie_release_device(struct apple_pcie_port *port,
702702
struct pci_dev *pdev)
703703
{
704-
u32 rid = PCI_DEVID(pdev->bus->number, pdev->devfn);
704+
u32 rid = pci_dev_id(pdev);
705705
int idx;
706706

707707
mutex_lock(&port->pcie->lock);

0 commit comments

Comments
 (0)