aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/generic.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-06-08 09:14:31 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-06-08 09:14:31 -0400
commitea30759643b423933ced48acdd78e5299f05295b (patch)
treecaad66ce252b0d9d8aeb75f775c669fe5a9291de /drivers/ide/pci/generic.c
parent0d2157f78d17fcee17791f54959e67cc0af0da74 (diff)
ide: generic IDE PCI driver, add another device exception
generic IDE PCI driver, add another device exception This device is char device and is grabbed by generic ide driver: 00:0b.0 Class ffff: National Semiconductor Corporation 87410 IDE (rev ff) (prog-if ff) Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Disallow generic IDE PCI driver to grab it by adding next condition. Also consolidate exceptions to one bigger 'switch (dev->vendor)'. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Ingo Korb <ml@akana.de> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/generic.c')
-rw-r--r--drivers/ide/pci/generic.c37
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 = {
198static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id) 198static 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 }