Commit d76867ef authored by Yu Liao's avatar Yu Liao Committed by Jakub Kicinski

net: txgbe: use pci_dev_id() helper

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: default avatarYu Liao <liaoyu15@huawei.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240826012100.3975175-1-liaoyu15@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent be04024a
...@@ -688,8 +688,7 @@ static int txgbe_ext_phy_init(struct txgbe *txgbe) ...@@ -688,8 +688,7 @@ static int txgbe_ext_phy_init(struct txgbe *txgbe)
mii_bus->parent = &pdev->dev; mii_bus->parent = &pdev->dev;
mii_bus->phy_mask = GENMASK(31, 1); mii_bus->phy_mask = GENMASK(31, 1);
mii_bus->priv = wx; mii_bus->priv = wx;
snprintf(mii_bus->id, MII_BUS_ID_SIZE, "txgbe-%x", snprintf(mii_bus->id, MII_BUS_ID_SIZE, "txgbe-%x", pci_dev_id(pdev));
(pdev->bus->number << 8) | pdev->devfn);
ret = devm_mdiobus_register(&pdev->dev, mii_bus); ret = devm_mdiobus_register(&pdev->dev, mii_bus);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment