diff options
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/pci/generic.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c index f2c5a141ca10..0d51a11e81da 100644 --- a/drivers/ide/pci/generic.c +++ b/drivers/ide/pci/generic.c | |||
@@ -198,32 +198,41 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = { | |||
198 | static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id) | 198 | static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
199 | { | 199 | { |
200 | ide_pci_device_t *d = &generic_chipsets[id->driver_data]; | 200 | ide_pci_device_t *d = &generic_chipsets[id->driver_data]; |
201 | u16 command; | ||
202 | int ret = -ENODEV; | 201 | int ret = -ENODEV; |
203 | 202 | ||
204 | /* Don't use the generic entry unless instructed to do so */ | 203 | /* Don't use the generic entry unless instructed to do so */ |
205 | if (id->driver_data == 0 && ide_generic_all == 0) | 204 | if (id->driver_data == 0 && ide_generic_all == 0) |
206 | goto out; | 205 | goto out; |
207 | 206 | ||
208 | if (dev->vendor == PCI_VENDOR_ID_UMC && | 207 | switch (dev->vendor) { |
209 | dev->device == PCI_DEVICE_ID_UMC_UM8886A && | 208 | case PCI_VENDOR_ID_UMC: |
210 | (!(PCI_FUNC(dev->devfn) & 1))) | 209 | if (dev->device == PCI_DEVICE_ID_UMC_UM8886A && |
211 | goto out; /* UM8886A/BF pair */ | 210 | !(PCI_FUNC(dev->devfn) & 1)) |
212 | 211 | goto out; /* UM8886A/BF pair */ | |
213 | if (dev->vendor == PCI_VENDOR_ID_OPTI && | 212 | break; |
214 | dev->device == PCI_DEVICE_ID_OPTI_82C558 && | 213 | case PCI_VENDOR_ID_OPTI: |
215 | (!(PCI_FUNC(dev->devfn) & 1))) | 214 | if (dev->device == PCI_DEVICE_ID_OPTI_82C558 && |
216 | goto out; | 215 | !(PCI_FUNC(dev->devfn) & 1)) |
217 | 216 | goto out; | |
218 | if (dev->vendor == PCI_VENDOR_ID_JMICRON) { | 217 | break; |
219 | if (dev->device != PCI_DEVICE_ID_JMICRON_JMB368 && PCI_FUNC(dev->devfn) != 1) | 218 | case PCI_VENDOR_ID_JMICRON: |
219 | if (dev->device != PCI_DEVICE_ID_JMICRON_JMB368 && | ||
220 | PCI_FUNC(dev->devfn) != 1) | ||
221 | goto out; | ||
222 | break; | ||
223 | case PCI_VENDOR_ID_NS: | ||
224 | if (dev->device == PCI_DEVICE_ID_NS_87410 && | ||
225 | (dev->class >> 8) != PCI_CLASS_STORAGE_IDE) | ||
220 | goto out; | 226 | goto out; |
227 | break; | ||
221 | } | 228 | } |
222 | 229 | ||
223 | if (dev->vendor != PCI_VENDOR_ID_JMICRON) { | 230 | if (dev->vendor != PCI_VENDOR_ID_JMICRON) { |
231 | u16 command; | ||
224 | pci_read_config_word(dev, PCI_COMMAND, &command); | 232 | pci_read_config_word(dev, PCI_COMMAND, &command); |
225 | if (!(command & PCI_COMMAND_IO)) { | 233 | if (!(command & PCI_COMMAND_IO)) { |
226 | printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name); | 234 | printk(KERN_INFO "Skipping disabled %s IDE " |
235 | "controller.\n", d->name); | ||
227 | goto out; | 236 | goto out; |
228 | } | 237 | } |
229 | } | 238 | } |