diff options
Diffstat (limited to 'drivers/ide/pci/pdc202xx_new.c')
-rw-r--r-- | drivers/ide/pci/pdc202xx_new.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index 4c2b669d7de6..1f6791957227 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <asm/pci-bridge.h> | 31 | #include <asm/pci-bridge.h> |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #define DRV_NAME "pdc202xx_new" | ||
35 | |||
34 | #undef DEBUG | 36 | #undef DEBUG |
35 | 37 | ||
36 | #ifdef DEBUG | 38 | #ifdef DEBUG |
@@ -458,7 +460,7 @@ static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev) | |||
458 | 460 | ||
459 | if (dev2->irq != dev->irq) { | 461 | if (dev2->irq != dev->irq) { |
460 | dev2->irq = dev->irq; | 462 | dev2->irq = dev->irq; |
461 | printk(KERN_INFO "PDC20270 %s: PCI config space " | 463 | printk(KERN_INFO DRV_NAME " %s: PCI config space " |
462 | "interrupt fixed\n", pci_name(dev)); | 464 | "interrupt fixed\n", pci_name(dev)); |
463 | } | 465 | } |
464 | 466 | ||
@@ -476,9 +478,9 @@ static const struct ide_port_ops pdcnew_port_ops = { | |||
476 | .cable_detect = pdcnew_cable_detect, | 478 | .cable_detect = pdcnew_cable_detect, |
477 | }; | 479 | }; |
478 | 480 | ||
479 | #define DECLARE_PDCNEW_DEV(name_str, udma) \ | 481 | #define DECLARE_PDCNEW_DEV(udma) \ |
480 | { \ | 482 | { \ |
481 | .name = name_str, \ | 483 | .name = DRV_NAME, \ |
482 | .init_chipset = init_chipset_pdcnew, \ | 484 | .init_chipset = init_chipset_pdcnew, \ |
483 | .port_ops = &pdcnew_port_ops, \ | 485 | .port_ops = &pdcnew_port_ops, \ |
484 | .host_flags = IDE_HFLAG_POST_SET_MODE | \ | 486 | .host_flags = IDE_HFLAG_POST_SET_MODE | \ |
@@ -490,13 +492,8 @@ static const struct ide_port_ops pdcnew_port_ops = { | |||
490 | } | 492 | } |
491 | 493 | ||
492 | static const struct ide_port_info pdcnew_chipsets[] __devinitdata = { | 494 | static const struct ide_port_info pdcnew_chipsets[] __devinitdata = { |
493 | /* 0 */ DECLARE_PDCNEW_DEV("PDC20268", ATA_UDMA5), | 495 | /* 0: PDC202{68,70} */ DECLARE_PDCNEW_DEV(ATA_UDMA5), |
494 | /* 1 */ DECLARE_PDCNEW_DEV("PDC20269", ATA_UDMA6), | 496 | /* 1: PDC202{69,71,75,76,77} */ DECLARE_PDCNEW_DEV(ATA_UDMA6), |
495 | /* 2 */ DECLARE_PDCNEW_DEV("PDC20270", ATA_UDMA5), | ||
496 | /* 3 */ DECLARE_PDCNEW_DEV("PDC20271", ATA_UDMA6), | ||
497 | /* 4 */ DECLARE_PDCNEW_DEV("PDC20275", ATA_UDMA6), | ||
498 | /* 5 */ DECLARE_PDCNEW_DEV("PDC20276", ATA_UDMA6), | ||
499 | /* 6 */ DECLARE_PDCNEW_DEV("PDC20277", ATA_UDMA6), | ||
500 | }; | 497 | }; |
501 | 498 | ||
502 | /** | 499 | /** |
@@ -510,13 +507,10 @@ static const struct ide_port_info pdcnew_chipsets[] __devinitdata = { | |||
510 | 507 | ||
511 | static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_device_id *id) | 508 | static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
512 | { | 509 | { |
513 | const struct ide_port_info *d; | 510 | const struct ide_port_info *d = &pdcnew_chipsets[id->driver_data]; |
514 | struct pci_dev *bridge = dev->bus->self; | 511 | struct pci_dev *bridge = dev->bus->self; |
515 | u8 idx = id->driver_data; | ||
516 | |||
517 | d = &pdcnew_chipsets[idx]; | ||
518 | 512 | ||
519 | if (idx == 2 && bridge && | 513 | if (dev->device == PCI_DEVICE_ID_PROMISE_20270 && bridge && |
520 | bridge->vendor == PCI_VENDOR_ID_DEC && | 514 | bridge->vendor == PCI_VENDOR_ID_DEC && |
521 | bridge->device == PCI_DEVICE_ID_DEC_21150) { | 515 | bridge->device == PCI_DEVICE_ID_DEC_21150) { |
522 | struct pci_dev *dev2; | 516 | struct pci_dev *dev2; |
@@ -534,11 +528,11 @@ static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_de | |||
534 | } | 528 | } |
535 | } | 529 | } |
536 | 530 | ||
537 | if (idx == 5 && bridge && | 531 | if (dev->device == PCI_DEVICE_ID_PROMISE_20276 && bridge && |
538 | bridge->vendor == PCI_VENDOR_ID_INTEL && | 532 | bridge->vendor == PCI_VENDOR_ID_INTEL && |
539 | (bridge->device == PCI_DEVICE_ID_INTEL_I960 || | 533 | (bridge->device == PCI_DEVICE_ID_INTEL_I960 || |
540 | bridge->device == PCI_DEVICE_ID_INTEL_I960RM)) { | 534 | bridge->device == PCI_DEVICE_ID_INTEL_I960RM)) { |
541 | printk(KERN_INFO "PDC20276 %s: attached to I2O RAID controller," | 535 | printk(KERN_INFO DRV_NAME " %s: attached to I2O RAID controller," |
542 | " skipping\n", pci_name(dev)); | 536 | " skipping\n", pci_name(dev)); |
543 | return -ENODEV; | 537 | return -ENODEV; |
544 | } | 538 | } |
@@ -558,11 +552,11 @@ static void __devexit pdc202new_remove(struct pci_dev *dev) | |||
558 | static const struct pci_device_id pdc202new_pci_tbl[] = { | 552 | static const struct pci_device_id pdc202new_pci_tbl[] = { |
559 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20268), 0 }, | 553 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20268), 0 }, |
560 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20269), 1 }, | 554 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20269), 1 }, |
561 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20270), 2 }, | 555 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20270), 0 }, |
562 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20271), 3 }, | 556 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20271), 1 }, |
563 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20275), 4 }, | 557 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20275), 1 }, |
564 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20276), 5 }, | 558 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20276), 1 }, |
565 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20277), 6 }, | 559 | { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20277), 1 }, |
566 | { 0, }, | 560 | { 0, }, |
567 | }; | 561 | }; |
568 | MODULE_DEVICE_TABLE(pci, pdc202new_pci_tbl); | 562 | MODULE_DEVICE_TABLE(pci, pdc202new_pci_tbl); |