diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-18 18:30:09 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-18 18:30:09 -0400 |
commit | 97f84baa030c9e2d235e26e4a96fe7e294049cb0 (patch) | |
tree | 8317f6428712b66050d2a054f97765ddd230afcf /drivers/ide/pci/pdc202xx_old.c | |
parent | 099b1f42ab631f88a0321ae5468809fe907eb4d5 (diff) |
pdc202xx_old: remove ->init_setup
* Split off pdc202ata4_fixup_irq() helper from init_setup_pdc202ata4().
* Merge init_setup_{pdc202ata4,pdc20265,pdc202xx}() into pdc202xx_init_one().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/pdc202xx_old.c')
-rw-r--r-- | drivers/ide/pci/pdc202xx_old.c | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index 570259093ce4..d7b2210b4ebc 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c | |||
@@ -369,8 +369,8 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase) | |||
369 | ide_setup_dma(hwif, dmabase, 8); | 369 | ide_setup_dma(hwif, dmabase, 8); |
370 | } | 370 | } |
371 | 371 | ||
372 | static int __devinit init_setup_pdc202ata4(struct pci_dev *dev, | 372 | static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev, |
373 | ide_pci_device_t *d) | 373 | const char *name) |
374 | { | 374 | { |
375 | if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) { | 375 | if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) { |
376 | u8 irq = 0, irq2 = 0; | 376 | u8 irq = 0, irq2 = 0; |
@@ -380,37 +380,15 @@ static int __devinit init_setup_pdc202ata4(struct pci_dev *dev, | |||
380 | if (irq != irq2) { | 380 | if (irq != irq2) { |
381 | pci_write_config_byte(dev, | 381 | pci_write_config_byte(dev, |
382 | (PCI_INTERRUPT_LINE)|0x80, irq); /* 0xbc */ | 382 | (PCI_INTERRUPT_LINE)|0x80, irq); /* 0xbc */ |
383 | printk(KERN_INFO "%s: pci-config space interrupt " | 383 | printk(KERN_INFO "%s: PCI config space interrupt " |
384 | "mirror fixed.\n", d->name); | 384 | "mirror fixed\n", name); |
385 | } | 385 | } |
386 | } | 386 | } |
387 | return ide_setup_pci_device(dev, d); | ||
388 | } | ||
389 | |||
390 | static int __devinit init_setup_pdc20265(struct pci_dev *dev, | ||
391 | ide_pci_device_t *d) | ||
392 | { | ||
393 | if ((dev->bus->self) && | ||
394 | (dev->bus->self->vendor == PCI_VENDOR_ID_INTEL) && | ||
395 | ((dev->bus->self->device == PCI_DEVICE_ID_INTEL_I960) || | ||
396 | (dev->bus->self->device == PCI_DEVICE_ID_INTEL_I960RM))) { | ||
397 | printk(KERN_INFO "ide: Skipping Promise PDC20265 " | ||
398 | "attached to I2O RAID controller.\n"); | ||
399 | return -ENODEV; | ||
400 | } | ||
401 | return ide_setup_pci_device(dev, d); | ||
402 | } | ||
403 | |||
404 | static int __devinit init_setup_pdc202xx(struct pci_dev *dev, | ||
405 | ide_pci_device_t *d) | ||
406 | { | ||
407 | return ide_setup_pci_device(dev, d); | ||
408 | } | 387 | } |
409 | 388 | ||
410 | static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { | 389 | static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { |
411 | { /* 0 */ | 390 | { /* 0 */ |
412 | .name = "PDC20246", | 391 | .name = "PDC20246", |
413 | .init_setup = init_setup_pdc202ata4, | ||
414 | .init_chipset = init_chipset_pdc202xx, | 392 | .init_chipset = init_chipset_pdc202xx, |
415 | .init_hwif = init_hwif_pdc202xx, | 393 | .init_hwif = init_hwif_pdc202xx, |
416 | .init_dma = init_dma_pdc202xx, | 394 | .init_dma = init_dma_pdc202xx, |
@@ -421,7 +399,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { | |||
421 | .udma_mask = ATA_UDMA2, | 399 | .udma_mask = ATA_UDMA2, |
422 | },{ /* 1 */ | 400 | },{ /* 1 */ |
423 | .name = "PDC20262", | 401 | .name = "PDC20262", |
424 | .init_setup = init_setup_pdc202ata4, | ||
425 | .init_chipset = init_chipset_pdc202xx, | 402 | .init_chipset = init_chipset_pdc202xx, |
426 | .init_hwif = init_hwif_pdc202xx, | 403 | .init_hwif = init_hwif_pdc202xx, |
427 | .init_dma = init_dma_pdc202xx, | 404 | .init_dma = init_dma_pdc202xx, |
@@ -432,7 +409,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { | |||
432 | .udma_mask = ATA_UDMA4, | 409 | .udma_mask = ATA_UDMA4, |
433 | },{ /* 2 */ | 410 | },{ /* 2 */ |
434 | .name = "PDC20263", | 411 | .name = "PDC20263", |
435 | .init_setup = init_setup_pdc202ata4, | ||
436 | .init_chipset = init_chipset_pdc202xx, | 412 | .init_chipset = init_chipset_pdc202xx, |
437 | .init_hwif = init_hwif_pdc202xx, | 413 | .init_hwif = init_hwif_pdc202xx, |
438 | .init_dma = init_dma_pdc202xx, | 414 | .init_dma = init_dma_pdc202xx, |
@@ -443,7 +419,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { | |||
443 | .udma_mask = ATA_UDMA4, | 419 | .udma_mask = ATA_UDMA4, |
444 | },{ /* 3 */ | 420 | },{ /* 3 */ |
445 | .name = "PDC20265", | 421 | .name = "PDC20265", |
446 | .init_setup = init_setup_pdc20265, | ||
447 | .init_chipset = init_chipset_pdc202xx, | 422 | .init_chipset = init_chipset_pdc202xx, |
448 | .init_hwif = init_hwif_pdc202xx, | 423 | .init_hwif = init_hwif_pdc202xx, |
449 | .init_dma = init_dma_pdc202xx, | 424 | .init_dma = init_dma_pdc202xx, |
@@ -454,7 +429,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { | |||
454 | .udma_mask = ATA_UDMA5, | 429 | .udma_mask = ATA_UDMA5, |
455 | },{ /* 4 */ | 430 | },{ /* 4 */ |
456 | .name = "PDC20267", | 431 | .name = "PDC20267", |
457 | .init_setup = init_setup_pdc202xx, | ||
458 | .init_chipset = init_chipset_pdc202xx, | 432 | .init_chipset = init_chipset_pdc202xx, |
459 | .init_hwif = init_hwif_pdc202xx, | 433 | .init_hwif = init_hwif_pdc202xx, |
460 | .init_dma = init_dma_pdc202xx, | 434 | .init_dma = init_dma_pdc202xx, |
@@ -477,9 +451,28 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { | |||
477 | 451 | ||
478 | static int __devinit pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) | 452 | static int __devinit pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
479 | { | 453 | { |
480 | ide_pci_device_t *d = &pdc202xx_chipsets[id->driver_data]; | 454 | ide_pci_device_t *d; |
455 | u8 idx = id->driver_data; | ||
456 | |||
457 | d = &pdc202xx_chipsets[idx]; | ||
458 | |||
459 | if (idx < 3) | ||
460 | pdc202ata4_fixup_irq(dev, d->name); | ||
461 | |||
462 | if (idx == 3) { | ||
463 | struct pci_dev *bridge = dev->bus->self; | ||
481 | 464 | ||
482 | return d->init_setup(dev, d); | 465 | if (bridge && |
466 | bridge->vendor == PCI_VENDOR_ID_INTEL && | ||
467 | (bridge->device == PCI_DEVICE_ID_INTEL_I960 || | ||
468 | bridge->device == PCI_DEVICE_ID_INTEL_I960RM)) { | ||
469 | printk(KERN_INFO "ide: Skipping Promise PDC20265 " | ||
470 | "attached to I2O RAID controller\n"); | ||
471 | return -ENODEV; | ||
472 | } | ||
473 | } | ||
474 | |||
475 | return ide_setup_pci_device(dev, d); | ||
483 | } | 476 | } |
484 | 477 | ||
485 | static const struct pci_device_id pdc202xx_pci_tbl[] = { | 478 | static const struct pci_device_id pdc202xx_pci_tbl[] = { |