aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/pdc202xx_new.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-24 16:53:32 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-24 16:53:32 -0400
commitced3ec8aa7d0fa3300187ee47c144a22ccfc974e (patch)
treeea48651fe1b372685020cd67ac133240829c1576 /drivers/ide/pci/pdc202xx_new.c
parent04ba6e739e9c0623c25f94b191fd20dfbd1b26e3 (diff)
ide: prefix messages from IDE PCI host drivers by driver name
Prefix messages from IDE PCI host drivers by driver name instead of marketed chipset name (it is still possible to exactly identify the particular chipset basing on driver messages). As a bonus this provides nice code savings for some drivers: text data bss dec hex filename 3826 112 8 3946 f6a drivers/ide/pci/amd74xx.o.before 2786 112 8 2906 b5a drivers/ide/pci/amd74xx.o.after 764 108 0 872 368 drivers/ide/pci/cs5520.o.before 680 108 0 788 314 drivers/ide/pci/cs5520.o.after 1680 112 4 1796 704 drivers/ide/pci/generic.o.before 1155 112 4 1271 4f7 drivers/ide/pci/generic.o.after 7128 792 0 7920 1ef0 drivers/ide/pci/hpt366.o.before 6984 792 0 7776 1e60 drivers/ide/pci/hpt366.o.after 2800 148 0 2948 b84 drivers/ide/pci/pdc202xx_new.o.before 2523 148 0 2671 a6f drivers/ide/pci/pdc202xx_new.o.after 2831 148 0 2979 ba3 drivers/ide/pci/pdc202xx_old.o.before 2683 148 0 2831 b0f drivers/ide/pci/pdc202xx_old.o.after 3776 112 4 3892 f34 drivers/ide/pci/piix.o.before 2804 112 4 2920 b68 drivers/ide/pci/piix.o.after 4693 116 0 4809 12c9 drivers/ide/pci/siimage.o.before 4600 116 0 4716 126c drivers/ide/pci/siimage.o.after Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/pdc202xx_new.c')
-rw-r--r--drivers/ide/pci/pdc202xx_new.c38
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
492static const struct ide_port_info pdcnew_chipsets[] __devinitdata = { 494static 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
511static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_device_id *id) 508static 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)
558static const struct pci_device_id pdc202new_pci_tbl[] = { 552static 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};
568MODULE_DEVICE_TABLE(pci, pdc202new_pci_tbl); 562MODULE_DEVICE_TABLE(pci, pdc202new_pci_tbl);