Commit 702a98c63355b74aec50897870eb1c89b5009cfb

Authored by Ondrej Zary
Committed by Linus Torvalds
1 parent c94babbaf8

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>

Showing 2 changed files with 26 additions and 23 deletions Side-by-side Diff

drivers/scsi/g_NCR5380.c
... ... @@ -285,9 +285,12 @@
285 285 int __init generic_NCR5380_detect(struct scsi_host_template * tpnt)
286 286 {
287 287 static int current_override = 0;
288   - int count, i;
  288 + int count;
289 289 unsigned int *ports;
  290 +#ifndef SCSI_G_NCR5380_MEM
  291 + int i;
290 292 unsigned long region_size = 16;
  293 +#endif
291 294 static unsigned int __initdata ncr_53c400a_ports[] = {
292 295 0x280, 0x290, 0x300, 0x310, 0x330, 0x340, 0x348, 0x350, 0
293 296 };
... ... @@ -296,7 +299,7 @@
296 299 };
297 300 int flags = 0;
298 301 struct Scsi_Host *instance;
299   -#ifdef CONFIG_SCSI_G_NCR5380_MEM
  302 +#ifdef SCSI_G_NCR5380_MEM
300 303 unsigned long base;
301 304 void __iomem *iomem;
302 305 #endif
... ... @@ -315,7 +318,7 @@
315 318 overrides[0].board = BOARD_NCR53C400A;
316 319 else if (dtc_3181e != NCR_NOT_SET)
317 320 overrides[0].board = BOARD_DTC3181E;
318   -
  321 +#ifndef SCSI_G_NCR5380_MEM
319 322 if (!current_override && isapnp_present()) {
320 323 struct pnp_dev *dev = NULL;
321 324 count = 0;
... ... @@ -347,7 +350,7 @@
347 350 count++;
348 351 }
349 352 }
350   -
  353 +#endif
351 354 tpnt->proc_name = "g_NCR5380";
352 355  
353 356 for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
... ... @@ -372,7 +375,7 @@
372 375 break;
373 376 }
374 377  
375   -#ifndef CONFIG_SCSI_G_NCR5380_MEM
  378 +#ifndef SCSI_G_NCR5380_MEM
376 379 if (ports) {
377 380 /* wakeup sequence for the NCR53C400A and DTC3181E */
378 381  
... ... @@ -434,7 +437,7 @@
434 437 #endif
435 438 instance = scsi_register(tpnt, sizeof(struct NCR5380_hostdata));
436 439 if (instance == NULL) {
437   -#ifndef CONFIG_SCSI_G_NCR5380_MEM
  440 +#ifndef SCSI_G_NCR5380_MEM
438 441 release_region(overrides[current_override].NCR5380_map_name, region_size);
439 442 #else
440 443 iounmap(iomem);
441 444  
... ... @@ -444,10 +447,10 @@
444 447 }
445 448  
446 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 451 instance->n_io_port = region_size;
449 452 #else
450   - ((struct NCR5380_hostdata *)instance->hostdata).iomem = iomem;
  453 + ((struct NCR5380_hostdata *)instance->hostdata)->iomem = iomem;
451 454 #endif
452 455  
453 456 NCR5380_init(instance, flags);
454 457  
... ... @@ -515,10 +518,10 @@
515 518 free_irq(instance->irq, instance);
516 519 NCR5380_exit(instance);
517 520  
518   -#ifndef CONFIG_SCSI_G_NCR5380_MEM
  521 +#ifndef SCSI_G_NCR5380_MEM
519 522 release_region(instance->NCR5380_instance_name, instance->n_io_port);
520 523 #else
521   - iounmap(((struct NCR5380_hostdata *)instance->hostdata).iomem);
  524 + iounmap(((struct NCR5380_hostdata *)instance->hostdata)->iomem);
522 525 release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size);
523 526 #endif
524 527  
525 528  
... ... @@ -588,14 +591,14 @@
588 591 }
589 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 596 int i;
594 597 for (i = 0; i < 128; i++)
595 598 dst[start + i] = NCR5380_read(C400_HOST_BUFFER);
596 599 }
597 600 #else
598   - /* implies CONFIG_SCSI_G_NCR5380_MEM */
  601 + /* implies SCSI_G_NCR5380_MEM */
599 602 memcpy_fromio(dst + start, iomem + NCR53C400_host_buffer, 128);
600 603 #endif
601 604 start += 128;
602 605  
... ... @@ -608,14 +611,14 @@
608 611 // FIXME - no timeout
609 612 }
610 613  
611   -#ifndef CONFIG_SCSI_G_NCR5380_MEM
  614 +#ifndef SCSI_G_NCR5380_MEM
612 615 {
613 616 int i;
614 617 for (i = 0; i < 128; i++)
615 618 dst[start + i] = NCR5380_read(C400_HOST_BUFFER);
616 619 }
617 620 #else
618   - /* implies CONFIG_SCSI_G_NCR5380_MEM */
  621 + /* implies SCSI_G_NCR5380_MEM */
619 622 memcpy_fromio(dst + start, iomem + NCR53C400_host_buffer, 128);
620 623 #endif
621 624 start += 128;
622 625  
... ... @@ -674,13 +677,13 @@
674 677 }
675 678 while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY)
676 679 ; // FIXME - timeout
677   -#ifndef CONFIG_SCSI_G_NCR5380_MEM
  680 +#ifndef SCSI_G_NCR5380_MEM
678 681 {
679 682 for (i = 0; i < 128; i++)
680 683 NCR5380_write(C400_HOST_BUFFER, src[start + i]);
681 684 }
682 685 #else
683   - /* implies CONFIG_SCSI_G_NCR5380_MEM */
  686 + /* implies SCSI_G_NCR5380_MEM */
684 687 memcpy_toio(iomem + NCR53C400_host_buffer, src + start, 128);
685 688 #endif
686 689 start += 128;
687 690  
... ... @@ -690,13 +693,13 @@
690 693 while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY)
691 694 ; // FIXME - no timeout
692 695  
693   -#ifndef CONFIG_SCSI_G_NCR5380_MEM
  696 +#ifndef SCSI_G_NCR5380_MEM
694 697 {
695 698 for (i = 0; i < 128; i++)
696 699 NCR5380_write(C400_HOST_BUFFER, src[start + i]);
697 700 }
698 701 #else
699   - /* implies CONFIG_SCSI_G_NCR5380_MEM */
  702 + /* implies SCSI_G_NCR5380_MEM */
700 703 memcpy_toio(iomem + NCR53C400_host_buffer, src + start, 128);
701 704 #endif
702 705 start += 128;
... ... @@ -936,7 +939,7 @@
936 939 module_param(dtc_3181e, int, 0);
937 940 MODULE_LICENSE("GPL");
938 941  
939   -
  942 +#ifndef SCSI_G_NCR5380_MEM
940 943 static struct isapnp_device_id id_table[] __devinitdata = {
941 944 {
942 945 ISAPNP_ANY_ID, ISAPNP_ANY_ID,
... ... @@ -946,7 +949,7 @@
946 949 };
947 950  
948 951 MODULE_DEVICE_TABLE(isapnp, id_table);
949   -
  952 +#endif
950 953  
951 954 __setup("ncr5380=", do_NCR5380_setup);
952 955 __setup("ncr53c400=", do_NCR53C400_setup);
drivers/scsi/g_NCR5380.h
... ... @@ -63,7 +63,7 @@
63 63 #define __STRVAL(x) #x
64 64 #define STRVAL(x) __STRVAL(x)
65 65  
66   -#ifndef CONFIG_SCSI_G_NCR5380_MEM
  66 +#ifndef SCSI_G_NCR5380_MEM
67 67  
68 68 #define NCR5380_map_config port
69 69 #define NCR5380_map_type int
... ... @@ -91,7 +91,7 @@
91 91 NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
92 92  
93 93 #else
94   -/* therefore CONFIG_SCSI_G_NCR5380_MEM */
  94 +/* therefore SCSI_G_NCR5380_MEM */
95 95  
96 96 #define NCR5380_map_config memory
97 97 #define NCR5380_map_type unsigned long
... ... @@ -114,7 +114,7 @@
114 114 register void __iomem *iomem
115 115  
116 116 #define NCR5380_setup(instance) \
117   - iomem = (((struct NCR5380_hostdata *)(instance)->hostdata).iomem)
  117 + iomem = (((struct NCR5380_hostdata *)(instance)->hostdata)->iomem)
118 118  
119 119 #endif
120 120