Corrected TSCAN1 and TS7KV cards support to use IO address and base correctly.
authorppisa <ppisa>
Mon, 14 Apr 2008 02:32:58 +0000 (02:32 +0000)
committerppisa <ppisa>
Mon, 14 Apr 2008 02:32:58 +0000 (02:32 +0000)
The tsxxx_base variable should be used for ISA IO space base address only,
not as io_addr variable and "io" parameter unconditional override.

Thanks for problem analysis to Gonzalo A. de la Vega.

lincan/src/tscan1.c

index 841970a..dab8584 100644 (file)
@@ -281,7 +281,7 @@ int tscan1_init_hw_data(struct candevice_t *candev)
        io_addr = candev->io_addr;
 
        if(io_addr && (io_addr != (unsigned long)-1)) {
-               remap_io_addr = io_addr = tsxxx_base;
+               remap_io_addr = io_addr + tsxxx_base;
 
                if(tscan1_check_presence(remap_io_addr, &jmp)){
                        CANMSG("No TSCAN1 card found at address 0xlx\n");
@@ -298,7 +298,7 @@ int tscan1_init_hw_data(struct candevice_t *candev)
                        }
 
                        io_addr = TSCAN1_BASE_IO + i*TSXXX_IO_RANGE;
-                       remap_io_addr = io_addr = tsxxx_base;
+                       remap_io_addr = io_addr + tsxxx_base;
 
                        for (j = 0; j < MAX_HW_CARDS; j++) {
                                if(io[j] == io_addr){
@@ -368,7 +368,7 @@ int ts7kv_init_hw_data(struct candevice_t *candev)
        io_addr = candev->io_addr;
 
        if(io_addr && (io_addr != (unsigned long)-1)) {
-               remap_io_addr = io_addr = tsxxx_base;
+               remap_io_addr = io_addr + tsxxx_base;
 
                if(ts7kv_check_presence(remap_io_addr, &jmp)){
                        CANMSG("No TS7KV card found at address 0xlx\n");
@@ -385,7 +385,7 @@ int ts7kv_init_hw_data(struct candevice_t *candev)
                        }
 
                        io_addr = TS7KV_BASE_IO + i*TSXXX_IO_RANGE;
-                       remap_io_addr = io_addr = tsxxx_base;
+                       remap_io_addr = io_addr + tsxxx_base;
 
                        for (j = 0; j < MAX_HW_CARDS; j++) {
                                if(io[j] == io_addr){