Commit adc4d185 authored by Zheng Zengkai's avatar Zheng Zengkai Committed by David S. Miller

net: smsc: 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: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6ecb2ced
...@@ -1144,8 +1144,7 @@ static int smsc9420_mii_init(struct net_device *dev) ...@@ -1144,8 +1144,7 @@ static int smsc9420_mii_init(struct net_device *dev)
goto err_out_1; goto err_out_1;
} }
pd->mii_bus->name = DRV_MDIONAME; pd->mii_bus->name = DRV_MDIONAME;
snprintf(pd->mii_bus->id, MII_BUS_ID_SIZE, "%x", snprintf(pd->mii_bus->id, MII_BUS_ID_SIZE, "%x", pci_dev_id(pd->pdev));
(pd->pdev->bus->number << 8) | pd->pdev->devfn);
pd->mii_bus->priv = pd; pd->mii_bus->priv = pd;
pd->mii_bus->read = smsc9420_mii_read; pd->mii_bus->read = smsc9420_mii_read;
pd->mii_bus->write = smsc9420_mii_write; pd->mii_bus->write = smsc9420_mii_write;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment