diff options
author | Zheng Zengkai <zhengzengkai@huawei.com> | 2023-08-11 13:07:01 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-08-13 13:30:39 +0200 |
commit | ca51d1356071e40d48169a308e996be779be56d4 (patch) | |
tree | a0ab8ff0db062db779814962ea82750f1056a0d0 /drivers/net/ethernet/toshiba/tc35815.c | |
parent | net: smsc: Use pci_dev_id() to simplify the code (diff) | |
download | linux-ca51d1356071e40d48169a308e996be779be56d4.tar.xz linux-ca51d1356071e40d48169a308e996be779be56d4.zip |
net: tc35815: 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 '')
-rw-r--r-- | drivers/net/ethernet/toshiba/tc35815.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/toshiba/tc35815.c b/drivers/net/ethernet/toshiba/tc35815.c index b50be67b398b..14cf6ecf6d0d 100644 --- a/drivers/net/ethernet/toshiba/tc35815.c +++ b/drivers/net/ethernet/toshiba/tc35815.c @@ -667,8 +667,7 @@ static int tc_mii_init(struct net_device *dev) lp->mii_bus->name = "tc35815_mii_bus"; lp->mii_bus->read = tc_mdio_read; lp->mii_bus->write = tc_mdio_write; - snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%x", - (lp->pci_dev->bus->number << 8) | lp->pci_dev->devfn); + snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%x", pci_dev_id(lp->pci_dev)); lp->mii_bus->priv = dev; lp->mii_bus->parent = &lp->pci_dev->dev; err = mdiobus_register(lp->mii_bus); |