mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
et131x: 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>
This commit is contained in:
parent
2045b3938f
commit
fcbb797458
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user