Skip to content

Commit

Permalink
et131x: Use pci_dev_id() to simplify the code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zheng Zengkai authored and David S. Miller committed Aug 13, 2023
1 parent 2045b39 commit fcbb797
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/agere/et131x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fcbb797

Please sign in to comment.