Commit 893de2df authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

[PATCH] Char: cyclades, use pci_device_id

Use pci_device_id struct instead of ushort array. Add MODULE_DEVICE_TABLE.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 29d73aab
...@@ -829,17 +829,18 @@ static unsigned short cy_pci_nboard; ...@@ -829,17 +829,18 @@ static unsigned short cy_pci_nboard;
static unsigned short cy_isa_nboard; static unsigned short cy_isa_nboard;
static unsigned short cy_nboard; static unsigned short cy_nboard;
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
static unsigned short cy_pci_dev_id[] = { static struct pci_device_id cy_pci_dev_id[] __devinitdata = {
PCI_DEVICE_ID_CYCLOM_Y_Lo, /* PCI < 1Mb */ { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Y_Lo) }, /* PCI < 1Mb */
PCI_DEVICE_ID_CYCLOM_Y_Hi, /* PCI > 1Mb */ { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Y_Hi) }, /* PCI > 1Mb */
PCI_DEVICE_ID_CYCLOM_4Y_Lo, /* 4Y PCI < 1Mb */ { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_4Y_Lo) }, /* 4Y PCI < 1Mb */
PCI_DEVICE_ID_CYCLOM_4Y_Hi, /* 4Y PCI > 1Mb */ { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_4Y_Hi) }, /* 4Y PCI > 1Mb */
PCI_DEVICE_ID_CYCLOM_8Y_Lo, /* 8Y PCI < 1Mb */ { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_8Y_Lo) }, /* 8Y PCI < 1Mb */
PCI_DEVICE_ID_CYCLOM_8Y_Hi, /* 8Y PCI > 1Mb */ { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_8Y_Hi) }, /* 8Y PCI > 1Mb */
PCI_DEVICE_ID_CYCLOM_Z_Lo, /* Z PCI < 1Mb */ { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Z_Lo) }, /* Z PCI < 1Mb */
PCI_DEVICE_ID_CYCLOM_Z_Hi, /* Z PCI > 1Mb */ { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Z_Hi) }, /* Z PCI > 1Mb */
0 /* end of table */ { } /* end of table */
}; };
MODULE_DEVICE_TABLE(pci, cy_pci_dev_id);
#endif #endif
static void cy_start(struct tty_struct *); static void cy_start(struct tty_struct *);
...@@ -4758,7 +4759,7 @@ static int __init cy_detect_pci(void) ...@@ -4758,7 +4759,7 @@ static int __init cy_detect_pci(void)
for (i = 0; i < NR_CARDS; i++) { for (i = 0; i < NR_CARDS; i++) {
/* look for a Cyclades card by vendor and device id */ /* look for a Cyclades card by vendor and device id */
while ((device_id = cy_pci_dev_id[dev_index]) != 0) { while ((device_id = cy_pci_dev_id[dev_index].device) != 0) {
if ((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES, if ((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES,
device_id, pdev)) == NULL) { device_id, pdev)) == NULL) {
dev_index++; /* try next device id */ dev_index++; /* try next device id */
......
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