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

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.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent be04024a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -688,8 +688,7 @@ static int txgbe_ext_phy_init(struct txgbe *txgbe)
	mii_bus->parent = &pdev->dev;
	mii_bus->phy_mask = GENMASK(31, 1);
	mii_bus->priv = wx;
	snprintf(mii_bus->id, MII_BUS_ID_SIZE, "txgbe-%x",
		 (pdev->bus->number << 8) | pdev->devfn);
	snprintf(mii_bus->id, MII_BUS_ID_SIZE, "txgbe-%x", pci_dev_id(pdev));

	ret = devm_mdiobus_register(&pdev->dev, mii_bus);
	if (ret) {