[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240903072301.117767-1-zhangzekun11@huawei.com>
Date: Tue, 3 Sep 2024 15:23:01 +0800
From: Zhang Zekun <zhangzekun11@...wei.com>
To: <jiawenwu@...stnetic.com>, <mengyuanlou@...-swift.com>,
<avem@...emloft.net>, <netdev@...r.kernel.org>
CC: <zhangzekun11@...wei.com>
Subject: [PATCH net-next] net: txgbe: Simplify code with pci_dev_id()
Use pci_dev_id() to get the BDF number of a pci device, and we don't
calculate it manually. This can simplify the code a bit.
Signed-off-by: Zhang Zekun <zhangzekun11@...wei.com>
---
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
index 5f502265f0a6..e8e293b1dd61 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
@@ -689,7 +689,7 @@ static int txgbe_ext_phy_init(struct txgbe *txgbe)
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);
+ pci_dev_id(pdev));
ret = devm_mdiobus_register(&pdev->dev, mii_bus);
if (ret) {
--
2.17.1
Powered by blists - more mailing lists