projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3a3a09
)
PCI: apple: Use pci_dev_id() to simplify the code
author
Xiongfeng Wang
<wangxiongfeng2@huawei.com>
Mon, 7 Aug 2023 13:48:56 +0000
(21:48 +0800)
committer
Bjorn Helgaas
<bhelgaas@google.com>
Mon, 7 Aug 2023 21:13:06 +0000
(16:13 -0500)
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>
drivers/pci/controller/pcie-apple.c
patch
|
blob
|
history
diff --git
a/drivers/pci/controller/pcie-apple.c
b/drivers/pci/controller/pcie-apple.c
index 66f37e403a09c31dd9d3549c728cf48e47c2b1e4..2abca318e22aea01fdd86931a1ab30ec8daa6440 100644
(file)
--- a/
drivers/pci/controller/pcie-apple.c
+++ b/
drivers/pci/controller/pcie-apple.c
@@
-670,7
+670,7
@@
static struct apple_pcie_port *apple_pcie_get_port(struct pci_dev *pdev)
static int apple_pcie_add_device(struct apple_pcie_port *port,
struct pci_dev *pdev)
{
- u32 sid, rid =
PCI_DEVID(pdev->bus->number, pdev->devfn
);
+ u32 sid, rid =
pci_dev_id(pdev
);
int idx, err;
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,
static void apple_pcie_release_device(struct apple_pcie_port *port,
struct pci_dev *pdev)
{
- u32 rid =
PCI_DEVID(pdev->bus->number, pdev->devfn
);
+ u32 rid =
pci_dev_id(pdev
);
int idx;
mutex_lock(&port->pcie->lock);