aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ata_piix.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-09-01 07:17:36 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-12 14:55:38 -0400
commitec300d99ef8699a6f383889b8f8c0d0ebadc2a74 (patch)
treef7185868783318ea25d473a724860d292c0b84a1 /drivers/ata/ata_piix.c
parent7c9ef8e418374aec0a62e64d9b40d457634fd039 (diff)
[libata] ata_piix: Use more-robust form of array initialization
Use a form of array init that is less fragile, less sensitive to trivial typos and ordering mismatches. Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/ata_piix.c')
-rw-r--r--drivers/ata/ata_piix.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 45e3b60f26d0..7adb2aa009aa 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -123,7 +123,6 @@ enum {
123 ich_pata_33 = 1, /* ICH up to UDMA 33 only */ 123 ich_pata_33 = 1, /* ICH up to UDMA 33 only */
124 ich_pata_66 = 2, /* ICH up to 66 Mhz */ 124 ich_pata_66 = 2, /* ICH up to 66 Mhz */
125 ich_pata_100 = 3, /* ICH up to UDMA 100 */ 125 ich_pata_100 = 3, /* ICH up to UDMA 100 */
126 /* ICH up to UDMA 133 is not supported */
127 ich5_sata = 5, 126 ich5_sata = 5,
128 ich6_sata = 6, 127 ich6_sata = 6,
129 ich6_sata_ahci = 7, 128 ich6_sata_ahci = 7,
@@ -459,7 +458,7 @@ static const struct piix_map_db *piix_map_db_table[] = {
459}; 458};
460 459
461static struct ata_port_info piix_port_info[] = { 460static struct ata_port_info piix_port_info[] = {
462 /* piix_pata_33: 0: PIIX4 at 33MHz */ 461 [piix_pata_33] = /* PIIX4 at 33MHz */
463 { 462 {
464 .sht = &piix_sht, 463 .sht = &piix_sht,
465 .flags = PIIX_PATA_FLAGS, 464 .flags = PIIX_PATA_FLAGS,
@@ -469,7 +468,7 @@ static struct ata_port_info piix_port_info[] = {
469 .port_ops = &piix_pata_ops, 468 .port_ops = &piix_pata_ops,
470 }, 469 },
471 470
472 /* ich_pata_33: 1 ICH0 - ICH at 33Mhz*/ 471 [ich_pata_33] = /* ICH0 - ICH at 33Mhz*/
473 { 472 {
474 .sht = &piix_sht, 473 .sht = &piix_sht,
475 .flags = PIIX_PATA_FLAGS, 474 .flags = PIIX_PATA_FLAGS,
@@ -478,7 +477,8 @@ static struct ata_port_info piix_port_info[] = {
478 .udma_mask = ATA_UDMA2, /* UDMA33 */ 477 .udma_mask = ATA_UDMA2, /* UDMA33 */
479 .port_ops = &ich_pata_ops, 478 .port_ops = &ich_pata_ops,
480 }, 479 },
481 /* ich_pata_66: 2 ICH controllers up to 66MHz */ 480
481 [ich_pata_66] = /* ICH controllers up to 66MHz */
482 { 482 {
483 .sht = &piix_sht, 483 .sht = &piix_sht,
484 .flags = PIIX_PATA_FLAGS, 484 .flags = PIIX_PATA_FLAGS,
@@ -488,7 +488,7 @@ static struct ata_port_info piix_port_info[] = {
488 .port_ops = &ich_pata_ops, 488 .port_ops = &ich_pata_ops,
489 }, 489 },
490 490
491 /* ich_pata_100: 3 */ 491 [ich_pata_100] =
492 { 492 {
493 .sht = &piix_sht, 493 .sht = &piix_sht,
494 .flags = PIIX_PATA_FLAGS | PIIX_FLAG_CHECKINTR, 494 .flags = PIIX_PATA_FLAGS | PIIX_FLAG_CHECKINTR,
@@ -498,17 +498,7 @@ static struct ata_port_info piix_port_info[] = {
498 .port_ops = &ich_pata_ops, 498 .port_ops = &ich_pata_ops,
499 }, 499 },
500 500
501 /* ich_pata_133: 4 - Not supported - */ 501 [ich5_sata] =
502 {
503 .sht = &piix_sht,
504 .flags = PIIX_PATA_FLAGS | PIIX_FLAG_CHECKINTR,
505 .pio_mask = 0x1f, /* pio 0-4 */
506 .mwdma_mask = 0x06, /* Check: maybe 0x07 */
507 .udma_mask = ATA_UDMA6, /* UDMA133 */
508 .port_ops = &ich_pata_ops,
509 },
510
511 /* ich5_sata: 5 */
512 { 502 {
513 .sht = &piix_sht, 503 .sht = &piix_sht,
514 .flags = PIIX_SATA_FLAGS, 504 .flags = PIIX_SATA_FLAGS,
@@ -518,7 +508,7 @@ static struct ata_port_info piix_port_info[] = {
518 .port_ops = &piix_sata_ops, 508 .port_ops = &piix_sata_ops,
519 }, 509 },
520 510
521 /* ich6_sata: 6 */ 511 [ich6_sata] =
522 { 512 {
523 .sht = &piix_sht, 513 .sht = &piix_sht,
524 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR, 514 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR,
@@ -528,7 +518,7 @@ static struct ata_port_info piix_port_info[] = {
528 .port_ops = &piix_sata_ops, 518 .port_ops = &piix_sata_ops,
529 }, 519 },
530 520
531 /* ich6_sata_ahci: 7 */ 521 [ich6_sata_ahci] =
532 { 522 {
533 .sht = &piix_sht, 523 .sht = &piix_sht,
534 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR | 524 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
@@ -539,7 +529,7 @@ static struct ata_port_info piix_port_info[] = {
539 .port_ops = &piix_sata_ops, 529 .port_ops = &piix_sata_ops,
540 }, 530 },
541 531
542 /* ich6m_sata_ahci: 8 */ 532 [ich6m_sata_ahci] =
543 { 533 {
544 .sht = &piix_sht, 534 .sht = &piix_sht,
545 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR | 535 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
@@ -550,7 +540,7 @@ static struct ata_port_info piix_port_info[] = {
550 .port_ops = &piix_sata_ops, 540 .port_ops = &piix_sata_ops,
551 }, 541 },
552 542
553 /* ich8_sata_ahci: 9 */ 543 [ich8_sata_ahci] =
554 { 544 {
555 .sht = &piix_sht, 545 .sht = &piix_sht,
556 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR | 546 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
@@ -561,7 +551,7 @@ static struct ata_port_info piix_port_info[] = {
561 .port_ops = &piix_sata_ops, 551 .port_ops = &piix_sata_ops,
562 }, 552 },
563 553
564 /* piix_pata_mwdma: 10: PIIX3 MWDMA only */ 554 [piix_pata_mwdma] = /* PIIX3 MWDMA only */
565 { 555 {
566 .sht = &piix_sht, 556 .sht = &piix_sht,
567 .flags = PIIX_PATA_FLAGS, 557 .flags = PIIX_PATA_FLAGS,
@@ -570,7 +560,7 @@ static struct ata_port_info piix_port_info[] = {
570 .port_ops = &piix_pata_ops, 560 .port_ops = &piix_pata_ops,
571 }, 561 },
572 562
573 /* tolapai_sata_ahci: 11: */ 563 [tolapai_sata_ahci] =
574 { 564 {
575 .sht = &piix_sht, 565 .sht = &piix_sht,
576 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR | 566 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR |