Skip to content

Commit 96b3bff

Browse files
bhadramdavem330
authored andcommitted
ethernet: realtek: use pci_device_id
This patch use the struct pci_device_id instead of using macro DEFINE_PCI_DEVICE_TABLE which is deprecated and should not be used. And also moves these ids after probe and remove functionalities. Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5490c27 commit 96b3bff

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎drivers/net/ethernet/realtek/8139cp.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,6 @@ static int cp_get_eeprom(struct net_device *dev,
382382
static int cp_set_eeprom(struct net_device *dev,
383383
struct ethtool_eeprom *eeprom, u8 *data);
384384

385-
static DEFINE_PCI_DEVICE_TABLE(cp_pci_tbl) = {
386-
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139), },
387-
{ PCI_DEVICE(PCI_VENDOR_ID_TTTECH, PCI_DEVICE_ID_TTTECH_MC322), },
388-
{ },
389-
};
390-
MODULE_DEVICE_TABLE(pci, cp_pci_tbl);
391-
392385
static struct {
393386
const char str[ETH_GSTRING_LEN];
394387
} ethtool_stats_keys[] = {
@@ -2106,6 +2099,13 @@ static int cp_resume (struct pci_dev *pdev)
21062099
}
21072100
#endif /* CONFIG_PM */
21082101

2102+
static const struct pci_device_id cp_pci_tbl[] = {
2103+
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139), },
2104+
{ PCI_DEVICE(PCI_VENDOR_ID_TTTECH, PCI_DEVICE_ID_TTTECH_MC322), },
2105+
{ },
2106+
};
2107+
MODULE_DEVICE_TABLE(pci, cp_pci_tbl);
2108+
21092109
static struct pci_driver cp_driver = {
21102110
.name = DRV_NAME,
21112111
.id_table = cp_pci_tbl,

0 commit comments

Comments
 (0)