Skip to content

Commit 664ec38

Browse files
Jialin Zhangmpe
authored andcommitted
powerpc/eeh: Use pci_dev_id() to simplify the code
PCI core API pci_dev_id() can be used to get the BDF number for a pci device. We don't need to compose it mannually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230815023303.3515503-1-zhangjialin11@huawei.com
1 parent 5083272 commit 664ec38

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/powerpc/platforms/powernv/eeh-powernv.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,7 @@ static int pnv_eeh_bridge_reset(struct pci_dev *pdev, int option)
855855
struct pci_controller *hose = pci_bus_to_host(pdev->bus);
856856
struct pnv_phb *phb = hose->private_data;
857857
struct device_node *dn = pci_device_to_OF_node(pdev);
858-
uint64_t id = PCI_SLOT_ID(phb->opal_id,
859-
(pdev->bus->number << 8) | pdev->devfn);
858+
uint64_t id = PCI_SLOT_ID(phb->opal_id, pci_dev_id(pdev));
860859
uint8_t scope;
861860
int64_t rc;
862861

0 commit comments

Comments
 (0)