diff options
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/sc/shmem.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c index 034d41a61ae1..e0331e0094f1 100644 --- a/drivers/isdn/sc/shmem.c +++ b/drivers/isdn/sc/shmem.c | |||
@@ -28,15 +28,15 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n) | |||
28 | { | 28 | { |
29 | unsigned long flags; | 29 | unsigned long flags; |
30 | unsigned char ch; | 30 | unsigned char ch; |
31 | unsigned long dest_rem = ((unsigned long) dest) % 0x4000; | ||
31 | 32 | ||
32 | if(!IS_VALID_CARD(card)) { | 33 | if (!IS_VALID_CARD(card)) { |
33 | pr_debug("Invalid param: %d is not a valid card id\n", card); | 34 | pr_debug("Invalid param: %d is not a valid card id\n", card); |
34 | return; | 35 | return; |
35 | } | 36 | } |
36 | 37 | ||
37 | if(n > SRAM_PAGESIZE) { | 38 | if (n > SRAM_PAGESIZE) |
38 | return; | 39 | return; |
39 | } | ||
40 | 40 | ||
41 | /* | 41 | /* |
42 | * determine the page to load from the address | 42 | * determine the page to load from the address |
@@ -50,8 +50,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n) | |||
50 | 50 | ||
51 | outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80, | 51 | outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80, |
52 | sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]); | 52 | sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]); |
53 | memcpy_toio(sc_adapter[card]->rambase + | 53 | memcpy_toio(sc_adapter[card]->rambase + dest_rem, src, n); |
54 | ((unsigned long) dest % 0x4000), src, n); | ||
55 | spin_unlock_irqrestore(&sc_adapter[card]->lock, flags); | 54 | spin_unlock_irqrestore(&sc_adapter[card]->lock, flags); |
56 | pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename, | 55 | pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename, |
57 | ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); | 56 | ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); |