diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2007-04-19 06:09:52 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-19 19:20:52 -0400 |
commit | f3769e9db11df38c211881a5f11b2e38a8e4477a (patch) | |
tree | c16c66f2256f634a893554e858d8dfcc5d95897b | |
parent | 6f29e35e2d4cdbc3e8785982314e54ec5df4ad37 (diff) |
pata_sis: Fix oops on boot
A small number of SiS setups require special handling (not many judging
by how long this dumb bug survived). A couple of Fedora 7 devel testers
hit an Oops on pata_sis loading which is caused by terminal confusion
between chipset as 'the chipset we have found' and chipset as 'array
iterator'
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/ata/pata_sis.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index f48207865930..8dc3bc4f5863 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c | |||
@@ -878,6 +878,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
878 | struct ata_port_info *port; | 878 | struct ata_port_info *port; |
879 | struct pci_dev *host = NULL; | 879 | struct pci_dev *host = NULL; |
880 | struct sis_chipset *chipset = NULL; | 880 | struct sis_chipset *chipset = NULL; |
881 | struct sis_chipset *sets; | ||
881 | 882 | ||
882 | static struct sis_chipset sis_chipsets[] = { | 883 | static struct sis_chipset sis_chipsets[] = { |
883 | 884 | ||
@@ -932,10 +933,11 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
932 | 933 | ||
933 | /* We have to find the bridge first */ | 934 | /* We have to find the bridge first */ |
934 | 935 | ||
935 | for (chipset = &sis_chipsets[0]; chipset->device; chipset++) { | 936 | for (sets = &sis_chipsets[0]; sets->device; sets++) { |
936 | host = pci_get_device(PCI_VENDOR_ID_SI, chipset->device, NULL); | 937 | host = pci_get_device(PCI_VENDOR_ID_SI, sets->device, NULL); |
937 | if (host != NULL) { | 938 | if (host != NULL) { |
938 | if (chipset->device == 0x630) { /* SIS630 */ | 939 | chipset = sets; /* Match found */ |
940 | if (sets->device == 0x630) { /* SIS630 */ | ||
939 | u8 host_rev; | 941 | u8 host_rev; |
940 | pci_read_config_byte(host, PCI_REVISION_ID, &host_rev); | 942 | pci_read_config_byte(host, PCI_REVISION_ID, &host_rev); |
941 | if (host_rev >= 0x30) /* 630 ET */ | 943 | if (host_rev >= 0x30) /* 630 ET */ |
@@ -946,7 +948,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
946 | } | 948 | } |
947 | 949 | ||
948 | /* Look for concealed bridges */ | 950 | /* Look for concealed bridges */ |
949 | if (host == NULL) { | 951 | if (chipset == NULL) { |
950 | /* Second check */ | 952 | /* Second check */ |
951 | u32 idemisc; | 953 | u32 idemisc; |
952 | u16 trueid; | 954 | u16 trueid; |