Re: [PATCH] powerpc/eeh: Use pci_dev_id() to simplify the code

2023-08-30 Thread Michael Ellerman
On Tue, 15 Aug 2023 10:33:03 +0800, Jialin Zhang wrote:
> 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.
> 
> 

Applied to powerpc/next.

[1/1] powerpc/eeh: Use pci_dev_id() to simplify the code
  https://git.kernel.org/powerpc/c/664ec38673bef18bbcc4ede02274c8977470823f

cheers


[PATCH] powerpc/eeh: Use pci_dev_id() to simplify the code

2023-08-15 Thread Jialin Zhang
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 
---
 arch/powerpc/platforms/powernv/eeh-powernv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c 
b/arch/powerpc/platforms/powernv/eeh-powernv.c
index a83cb679dd59..af3a5d37a149 100644
--- a/arch/powerpc/platforms/powernv/eeh-powernv.c
+++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
@@ -855,8 +855,7 @@ static int pnv_eeh_bridge_reset(struct pci_dev *pdev, int 
option)
struct pci_controller *hose = pci_bus_to_host(pdev->bus);
struct pnv_phb *phb = hose->private_data;
struct device_node *dn = pci_device_to_OF_node(pdev);
-   uint64_t id = PCI_SLOT_ID(phb->opal_id,
- (pdev->bus->number << 8) | pdev->devfn);
+   uint64_t id = PCI_SLOT_ID(phb->opal_id, pci_dev_id(pdev));
uint8_t scope;
int64_t rc;
 
-- 
2.25.1