diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-02-12 03:51:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:28 -0500 |
commit | 893de2dffb0923d9bdba4abd66afcec3cf9103ba (patch) | |
tree | 49838b3400d82177e0158a17f92ac059e8d181aa /drivers | |
parent | 29d73aab3368ff18006c3591bc6d2f54c06c9bcb (diff) |
[PATCH] Char: cyclades, use pci_device_id
Use pci_device_id struct instead of ushort array. Add MODULE_DEVICE_TABLE.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/cyclades.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 363beb165729..54df35527bc5 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c | |||
@@ -829,17 +829,18 @@ static unsigned short cy_pci_nboard; | |||
829 | static unsigned short cy_isa_nboard; | 829 | static unsigned short cy_isa_nboard; |
830 | static unsigned short cy_nboard; | 830 | static unsigned short cy_nboard; |
831 | #ifdef CONFIG_PCI | 831 | #ifdef CONFIG_PCI |
832 | static unsigned short cy_pci_dev_id[] = { | 832 | static struct pci_device_id cy_pci_dev_id[] __devinitdata = { |
833 | PCI_DEVICE_ID_CYCLOM_Y_Lo, /* PCI < 1Mb */ | 833 | { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Y_Lo) }, /* PCI < 1Mb */ |
834 | PCI_DEVICE_ID_CYCLOM_Y_Hi, /* PCI > 1Mb */ | 834 | { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Y_Hi) }, /* PCI > 1Mb */ |
835 | PCI_DEVICE_ID_CYCLOM_4Y_Lo, /* 4Y PCI < 1Mb */ | 835 | { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_4Y_Lo) }, /* 4Y PCI < 1Mb */ |
836 | PCI_DEVICE_ID_CYCLOM_4Y_Hi, /* 4Y PCI > 1Mb */ | 836 | { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_4Y_Hi) }, /* 4Y PCI > 1Mb */ |
837 | PCI_DEVICE_ID_CYCLOM_8Y_Lo, /* 8Y PCI < 1Mb */ | 837 | { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_8Y_Lo) }, /* 8Y PCI < 1Mb */ |
838 | PCI_DEVICE_ID_CYCLOM_8Y_Hi, /* 8Y PCI > 1Mb */ | 838 | { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_8Y_Hi) }, /* 8Y PCI > 1Mb */ |
839 | PCI_DEVICE_ID_CYCLOM_Z_Lo, /* Z PCI < 1Mb */ | 839 | { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Z_Lo) }, /* Z PCI < 1Mb */ |
840 | PCI_DEVICE_ID_CYCLOM_Z_Hi, /* Z PCI > 1Mb */ | 840 | { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Z_Hi) }, /* Z PCI > 1Mb */ |
841 | 0 /* end of table */ | 841 | { } /* end of table */ |
842 | }; | 842 | }; |
843 | MODULE_DEVICE_TABLE(pci, cy_pci_dev_id); | ||
843 | #endif | 844 | #endif |
844 | 845 | ||
845 | static void cy_start(struct tty_struct *); | 846 | static void cy_start(struct tty_struct *); |
@@ -4758,7 +4759,7 @@ static int __init cy_detect_pci(void) | |||
4758 | 4759 | ||
4759 | for (i = 0; i < NR_CARDS; i++) { | 4760 | for (i = 0; i < NR_CARDS; i++) { |
4760 | /* look for a Cyclades card by vendor and device id */ | 4761 | /* look for a Cyclades card by vendor and device id */ |
4761 | while ((device_id = cy_pci_dev_id[dev_index]) != 0) { | 4762 | while ((device_id = cy_pci_dev_id[dev_index].device) != 0) { |
4762 | if ((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES, | 4763 | if ((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES, |
4763 | device_id, pdev)) == NULL) { | 4764 | device_id, pdev)) == NULL) { |
4764 | dev_index++; /* try next device id */ | 4765 | dev_index++; /* try next device id */ |