summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/agere/et131x.c
diff options
context:
space:
mode:
authorZheng Zengkai <zhengzengkai@huawei.com>2023-08-11 14:06:58 +0300
committerDavid S. Miller <davem@davemloft.net>2023-08-13 14:30:39 +0300
commitfcbb797458e123b3f304606199ded27b042118b1 (patch)
tree6c3279f72f9e5ed66f48689488f318d4ce058ac3 /drivers/net/ethernet/agere/et131x.c
parent2045b3938ffad5bc986f68b9bb44acb188c73792 (diff)
downloadlinux-fcbb797458e123b3f304606199ded27b042118b1.tar.xz
et131x: 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 manually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/agere/et131x.c')
-rw-r--r--drivers/net/ethernet/agere/et131x.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/agere/et131x.c b/drivers/net/ethernet/agere/et131x.c
index 5fab589b3ddf..3d9220f9c9fe 100644
--- a/drivers/net/ethernet/agere/et131x.c
+++ b/drivers/net/ethernet/agere/et131x.c
@@ -3982,8 +3982,7 @@ static int et131x_pci_setup(struct pci_dev *pdev,
}
adapter->mii_bus->name = "et131x_eth_mii";
- snprintf(adapter->mii_bus->id, MII_BUS_ID_SIZE, "%x",
- (adapter->pdev->bus->number << 8) | adapter->pdev->devfn);
+ snprintf(adapter->mii_bus->id, MII_BUS_ID_SIZE, "%x", pci_dev_id(adapter->pdev));
adapter->mii_bus->priv = netdev;
adapter->mii_bus->read = et131x_mdio_read;
adapter->mii_bus->write = et131x_mdio_write;