diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2010-08-10 21:01:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-11 11:59:00 -0400 |
commit | 702a98c63355b74aec50897870eb1c89b5009cfb (patch) | |
tree | 786be5ca878bfa469e996d26d9ea9be6d870ddee /drivers/scsi | |
parent | c94babbaf85c3162bd53a722ceeea32a0982d436 (diff) |
g_NCR5380: fix broken MMIO compilation
The ifdefs are broken so the MMIO code is never compiled and so it's
broken too. Fix them all. Untested as I don't have the hardware.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Andy Walls <awalls@md.metrocast.net>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/g_NCR5380.c | 43 | ||||
-rw-r--r-- | drivers/scsi/g_NCR5380.h | 6 |
2 files changed, 26 insertions, 23 deletions
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 6bc0015662e0..427a56d3117e 100644 --- a/drivers/scsi/g_NCR5380.c +++ b/drivers/scsi/g_NCR5380.c | |||
@@ -285,9 +285,12 @@ static int __init do_DTC3181E_setup(char *str) | |||
285 | int __init generic_NCR5380_detect(struct scsi_host_template * tpnt) | 285 | int __init generic_NCR5380_detect(struct scsi_host_template * tpnt) |
286 | { | 286 | { |
287 | static int current_override = 0; | 287 | static int current_override = 0; |
288 | int count, i; | 288 | int count; |
289 | unsigned int *ports; | 289 | unsigned int *ports; |
290 | #ifndef SCSI_G_NCR5380_MEM | ||
291 | int i; | ||
290 | unsigned long region_size = 16; | 292 | unsigned long region_size = 16; |
293 | #endif | ||
291 | static unsigned int __initdata ncr_53c400a_ports[] = { | 294 | static unsigned int __initdata ncr_53c400a_ports[] = { |
292 | 0x280, 0x290, 0x300, 0x310, 0x330, 0x340, 0x348, 0x350, 0 | 295 | 0x280, 0x290, 0x300, 0x310, 0x330, 0x340, 0x348, 0x350, 0 |
293 | }; | 296 | }; |
@@ -296,7 +299,7 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt) | |||
296 | }; | 299 | }; |
297 | int flags = 0; | 300 | int flags = 0; |
298 | struct Scsi_Host *instance; | 301 | struct Scsi_Host *instance; |
299 | #ifdef CONFIG_SCSI_G_NCR5380_MEM | 302 | #ifdef SCSI_G_NCR5380_MEM |
300 | unsigned long base; | 303 | unsigned long base; |
301 | void __iomem *iomem; | 304 | void __iomem *iomem; |
302 | #endif | 305 | #endif |
@@ -315,7 +318,7 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt) | |||
315 | overrides[0].board = BOARD_NCR53C400A; | 318 | overrides[0].board = BOARD_NCR53C400A; |
316 | else if (dtc_3181e != NCR_NOT_SET) | 319 | else if (dtc_3181e != NCR_NOT_SET) |
317 | overrides[0].board = BOARD_DTC3181E; | 320 | overrides[0].board = BOARD_DTC3181E; |
318 | 321 | #ifndef SCSI_G_NCR5380_MEM | |
319 | if (!current_override && isapnp_present()) { | 322 | if (!current_override && isapnp_present()) { |
320 | struct pnp_dev *dev = NULL; | 323 | struct pnp_dev *dev = NULL; |
321 | count = 0; | 324 | count = 0; |
@@ -347,7 +350,7 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt) | |||
347 | count++; | 350 | count++; |
348 | } | 351 | } |
349 | } | 352 | } |
350 | 353 | #endif | |
351 | tpnt->proc_name = "g_NCR5380"; | 354 | tpnt->proc_name = "g_NCR5380"; |
352 | 355 | ||
353 | for (count = 0; current_override < NO_OVERRIDES; ++current_override) { | 356 | for (count = 0; current_override < NO_OVERRIDES; ++current_override) { |
@@ -372,7 +375,7 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt) | |||
372 | break; | 375 | break; |
373 | } | 376 | } |
374 | 377 | ||
375 | #ifndef CONFIG_SCSI_G_NCR5380_MEM | 378 | #ifndef SCSI_G_NCR5380_MEM |
376 | if (ports) { | 379 | if (ports) { |
377 | /* wakeup sequence for the NCR53C400A and DTC3181E */ | 380 | /* wakeup sequence for the NCR53C400A and DTC3181E */ |
378 | 381 | ||
@@ -434,7 +437,7 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt) | |||
434 | #endif | 437 | #endif |
435 | instance = scsi_register(tpnt, sizeof(struct NCR5380_hostdata)); | 438 | instance = scsi_register(tpnt, sizeof(struct NCR5380_hostdata)); |
436 | if (instance == NULL) { | 439 | if (instance == NULL) { |
437 | #ifndef CONFIG_SCSI_G_NCR5380_MEM | 440 | #ifndef SCSI_G_NCR5380_MEM |
438 | release_region(overrides[current_override].NCR5380_map_name, region_size); | 441 | release_region(overrides[current_override].NCR5380_map_name, region_size); |
439 | #else | 442 | #else |
440 | iounmap(iomem); | 443 | iounmap(iomem); |
@@ -444,10 +447,10 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt) | |||
444 | } | 447 | } |
445 | 448 | ||
446 | instance->NCR5380_instance_name = overrides[current_override].NCR5380_map_name; | 449 | instance->NCR5380_instance_name = overrides[current_override].NCR5380_map_name; |
447 | #ifndef CONFIG_SCSI_G_NCR5380_MEM | 450 | #ifndef SCSI_G_NCR5380_MEM |
448 | instance->n_io_port = region_size; | 451 | instance->n_io_port = region_size; |
449 | #else | 452 | #else |
450 | ((struct NCR5380_hostdata *)instance->hostdata).iomem = iomem; | 453 | ((struct NCR5380_hostdata *)instance->hostdata)->iomem = iomem; |
451 | #endif | 454 | #endif |
452 | 455 | ||
453 | NCR5380_init(instance, flags); | 456 | NCR5380_init(instance, flags); |
@@ -515,10 +518,10 @@ int generic_NCR5380_release_resources(struct Scsi_Host *instance) | |||
515 | free_irq(instance->irq, instance); | 518 | free_irq(instance->irq, instance); |
516 | NCR5380_exit(instance); | 519 | NCR5380_exit(instance); |
517 | 520 | ||
518 | #ifndef CONFIG_SCSI_G_NCR5380_MEM | 521 | #ifndef SCSI_G_NCR5380_MEM |
519 | release_region(instance->NCR5380_instance_name, instance->n_io_port); | 522 | release_region(instance->NCR5380_instance_name, instance->n_io_port); |
520 | #else | 523 | #else |
521 | iounmap(((struct NCR5380_hostdata *)instance->hostdata).iomem); | 524 | iounmap(((struct NCR5380_hostdata *)instance->hostdata)->iomem); |
522 | release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size); | 525 | release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size); |
523 | #endif | 526 | #endif |
524 | 527 | ||
@@ -588,14 +591,14 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst, | |||
588 | } | 591 | } |
589 | while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY); | 592 | while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY); |
590 | 593 | ||
591 | #ifndef CONFIG_SCSI_G_NCR5380_MEM | 594 | #ifndef SCSI_G_NCR5380_MEM |
592 | { | 595 | { |
593 | int i; | 596 | int i; |
594 | for (i = 0; i < 128; i++) | 597 | for (i = 0; i < 128; i++) |
595 | dst[start + i] = NCR5380_read(C400_HOST_BUFFER); | 598 | dst[start + i] = NCR5380_read(C400_HOST_BUFFER); |
596 | } | 599 | } |
597 | #else | 600 | #else |
598 | /* implies CONFIG_SCSI_G_NCR5380_MEM */ | 601 | /* implies SCSI_G_NCR5380_MEM */ |
599 | memcpy_fromio(dst + start, iomem + NCR53C400_host_buffer, 128); | 602 | memcpy_fromio(dst + start, iomem + NCR53C400_host_buffer, 128); |
600 | #endif | 603 | #endif |
601 | start += 128; | 604 | start += 128; |
@@ -608,14 +611,14 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst, | |||
608 | // FIXME - no timeout | 611 | // FIXME - no timeout |
609 | } | 612 | } |
610 | 613 | ||
611 | #ifndef CONFIG_SCSI_G_NCR5380_MEM | 614 | #ifndef SCSI_G_NCR5380_MEM |
612 | { | 615 | { |
613 | int i; | 616 | int i; |
614 | for (i = 0; i < 128; i++) | 617 | for (i = 0; i < 128; i++) |
615 | dst[start + i] = NCR5380_read(C400_HOST_BUFFER); | 618 | dst[start + i] = NCR5380_read(C400_HOST_BUFFER); |
616 | } | 619 | } |
617 | #else | 620 | #else |
618 | /* implies CONFIG_SCSI_G_NCR5380_MEM */ | 621 | /* implies SCSI_G_NCR5380_MEM */ |
619 | memcpy_fromio(dst + start, iomem + NCR53C400_host_buffer, 128); | 622 | memcpy_fromio(dst + start, iomem + NCR53C400_host_buffer, 128); |
620 | #endif | 623 | #endif |
621 | start += 128; | 624 | start += 128; |
@@ -674,13 +677,13 @@ static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src, | |||
674 | } | 677 | } |
675 | while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY) | 678 | while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY) |
676 | ; // FIXME - timeout | 679 | ; // FIXME - timeout |
677 | #ifndef CONFIG_SCSI_G_NCR5380_MEM | 680 | #ifndef SCSI_G_NCR5380_MEM |
678 | { | 681 | { |
679 | for (i = 0; i < 128; i++) | 682 | for (i = 0; i < 128; i++) |
680 | NCR5380_write(C400_HOST_BUFFER, src[start + i]); | 683 | NCR5380_write(C400_HOST_BUFFER, src[start + i]); |
681 | } | 684 | } |
682 | #else | 685 | #else |
683 | /* implies CONFIG_SCSI_G_NCR5380_MEM */ | 686 | /* implies SCSI_G_NCR5380_MEM */ |
684 | memcpy_toio(iomem + NCR53C400_host_buffer, src + start, 128); | 687 | memcpy_toio(iomem + NCR53C400_host_buffer, src + start, 128); |
685 | #endif | 688 | #endif |
686 | start += 128; | 689 | start += 128; |
@@ -690,13 +693,13 @@ static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src, | |||
690 | while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY) | 693 | while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY) |
691 | ; // FIXME - no timeout | 694 | ; // FIXME - no timeout |
692 | 695 | ||
693 | #ifndef CONFIG_SCSI_G_NCR5380_MEM | 696 | #ifndef SCSI_G_NCR5380_MEM |
694 | { | 697 | { |
695 | for (i = 0; i < 128; i++) | 698 | for (i = 0; i < 128; i++) |
696 | NCR5380_write(C400_HOST_BUFFER, src[start + i]); | 699 | NCR5380_write(C400_HOST_BUFFER, src[start + i]); |
697 | } | 700 | } |
698 | #else | 701 | #else |
699 | /* implies CONFIG_SCSI_G_NCR5380_MEM */ | 702 | /* implies SCSI_G_NCR5380_MEM */ |
700 | memcpy_toio(iomem + NCR53C400_host_buffer, src + start, 128); | 703 | memcpy_toio(iomem + NCR53C400_host_buffer, src + start, 128); |
701 | #endif | 704 | #endif |
702 | start += 128; | 705 | start += 128; |
@@ -936,7 +939,7 @@ module_param(ncr_53c400a, int, 0); | |||
936 | module_param(dtc_3181e, int, 0); | 939 | module_param(dtc_3181e, int, 0); |
937 | MODULE_LICENSE("GPL"); | 940 | MODULE_LICENSE("GPL"); |
938 | 941 | ||
939 | 942 | #ifndef SCSI_G_NCR5380_MEM | |
940 | static struct isapnp_device_id id_table[] __devinitdata = { | 943 | static struct isapnp_device_id id_table[] __devinitdata = { |
941 | { | 944 | { |
942 | ISAPNP_ANY_ID, ISAPNP_ANY_ID, | 945 | ISAPNP_ANY_ID, ISAPNP_ANY_ID, |
@@ -946,7 +949,7 @@ static struct isapnp_device_id id_table[] __devinitdata = { | |||
946 | }; | 949 | }; |
947 | 950 | ||
948 | MODULE_DEVICE_TABLE(isapnp, id_table); | 951 | MODULE_DEVICE_TABLE(isapnp, id_table); |
949 | 952 | #endif | |
950 | 953 | ||
951 | __setup("ncr5380=", do_NCR5380_setup); | 954 | __setup("ncr5380=", do_NCR5380_setup); |
952 | __setup("ncr53c400=", do_NCR53C400_setup); | 955 | __setup("ncr53c400=", do_NCR53C400_setup); |
diff --git a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h index df0b3f69ef63..921764c9ab24 100644 --- a/drivers/scsi/g_NCR5380.h +++ b/drivers/scsi/g_NCR5380.h | |||
@@ -63,7 +63,7 @@ static const char* generic_NCR5380_info(struct Scsi_Host *); | |||
63 | #define __STRVAL(x) #x | 63 | #define __STRVAL(x) #x |
64 | #define STRVAL(x) __STRVAL(x) | 64 | #define STRVAL(x) __STRVAL(x) |
65 | 65 | ||
66 | #ifndef CONFIG_SCSI_G_NCR5380_MEM | 66 | #ifndef SCSI_G_NCR5380_MEM |
67 | 67 | ||
68 | #define NCR5380_map_config port | 68 | #define NCR5380_map_config port |
69 | #define NCR5380_map_type int | 69 | #define NCR5380_map_type int |
@@ -91,7 +91,7 @@ static const char* generic_NCR5380_info(struct Scsi_Host *); | |||
91 | NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name) | 91 | NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name) |
92 | 92 | ||
93 | #else | 93 | #else |
94 | /* therefore CONFIG_SCSI_G_NCR5380_MEM */ | 94 | /* therefore SCSI_G_NCR5380_MEM */ |
95 | 95 | ||
96 | #define NCR5380_map_config memory | 96 | #define NCR5380_map_config memory |
97 | #define NCR5380_map_type unsigned long | 97 | #define NCR5380_map_type unsigned long |
@@ -114,7 +114,7 @@ static const char* generic_NCR5380_info(struct Scsi_Host *); | |||
114 | register void __iomem *iomem | 114 | register void __iomem *iomem |
115 | 115 | ||
116 | #define NCR5380_setup(instance) \ | 116 | #define NCR5380_setup(instance) \ |
117 | iomem = (((struct NCR5380_hostdata *)(instance)->hostdata).iomem) | 117 | iomem = (((struct NCR5380_hostdata *)(instance)->hostdata)->iomem) |
118 | 118 | ||
119 | #endif | 119 | #endif |
120 | 120 | ||