diff options
author | Helge Deller <deller@gmx.de> | 2006-08-29 15:57:29 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-08-30 05:06:14 -0400 |
commit | e9422e091531c5851da4ffb8ee6dcbc36dc5b7a9 (patch) | |
tree | 5de45e4ac7c8ea051d859c08ab5adf2b8141a0f7 /drivers/serial | |
parent | d21b55d30b46c0b43821a2980e4998965fa37e33 (diff) |
[SERIAL] 8250: constify some serial structs
- some const- ification and usage of ARRAY_SIZE() in serial drivers
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/8250_pci.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index cd1979daf2b8..851e4839d6d9 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c | |||
@@ -458,11 +458,11 @@ static int pci_siig_setup(struct serial_private *priv, | |||
458 | * growing *huge*, we use this function to collapse some 70 entries | 458 | * growing *huge*, we use this function to collapse some 70 entries |
459 | * in the PCI table into one, for sanity's and compactness's sake. | 459 | * in the PCI table into one, for sanity's and compactness's sake. |
460 | */ | 460 | */ |
461 | static unsigned short timedia_single_port[] = { | 461 | static const unsigned short timedia_single_port[] = { |
462 | 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0 | 462 | 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0 |
463 | }; | 463 | }; |
464 | 464 | ||
465 | static unsigned short timedia_dual_port[] = { | 465 | static const unsigned short timedia_dual_port[] = { |
466 | 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085, | 466 | 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085, |
467 | 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079, | 467 | 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079, |
468 | 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079, | 468 | 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079, |
@@ -470,35 +470,34 @@ static unsigned short timedia_dual_port[] = { | |||
470 | 0xD079, 0 | 470 | 0xD079, 0 |
471 | }; | 471 | }; |
472 | 472 | ||
473 | static unsigned short timedia_quad_port[] = { | 473 | static const unsigned short timedia_quad_port[] = { |
474 | 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157, | 474 | 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157, |
475 | 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159, | 475 | 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159, |
476 | 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056, | 476 | 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056, |
477 | 0xB157, 0 | 477 | 0xB157, 0 |
478 | }; | 478 | }; |
479 | 479 | ||
480 | static unsigned short timedia_eight_port[] = { | 480 | static const unsigned short timedia_eight_port[] = { |
481 | 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166, | 481 | 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166, |
482 | 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0 | 482 | 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0 |
483 | }; | 483 | }; |
484 | 484 | ||
485 | static const struct timedia_struct { | 485 | static const struct timedia_struct { |
486 | int num; | 486 | int num; |
487 | unsigned short *ids; | 487 | const unsigned short *ids; |
488 | } timedia_data[] = { | 488 | } timedia_data[] = { |
489 | { 1, timedia_single_port }, | 489 | { 1, timedia_single_port }, |
490 | { 2, timedia_dual_port }, | 490 | { 2, timedia_dual_port }, |
491 | { 4, timedia_quad_port }, | 491 | { 4, timedia_quad_port }, |
492 | { 8, timedia_eight_port }, | 492 | { 8, timedia_eight_port } |
493 | { 0, NULL } | ||
494 | }; | 493 | }; |
495 | 494 | ||
496 | static int pci_timedia_init(struct pci_dev *dev) | 495 | static int pci_timedia_init(struct pci_dev *dev) |
497 | { | 496 | { |
498 | unsigned short *ids; | 497 | const unsigned short *ids; |
499 | int i, j; | 498 | int i, j; |
500 | 499 | ||
501 | for (i = 0; timedia_data[i].num; i++) { | 500 | for (i = 0; i < ARRAY_SIZE(timedia_data); i++) { |
502 | ids = timedia_data[i].ids; | 501 | ids = timedia_data[i].ids; |
503 | for (j = 0; ids[j]; j++) | 502 | for (j = 0; ids[j]; j++) |
504 | if (dev->subsystem_device == ids[j]) | 503 | if (dev->subsystem_device == ids[j]) |