aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 15:25:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 15:25:06 -0400
commit1685e633b396b0f3dabbc9fa5d65dfefe6435250 (patch)
treeee83e26e2468ca1518a1b065c690159e12c8def9 /drivers/mtd/maps
parent1cfd2bda8c486ae0e7a8005354758ebb68172bca (diff)
parent127c03cdbad9bd5af5d7f33bd31a1015a90cb77f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq pcmcia: do not request windows if you don't need to pcmcia: insert PCMCIA device resources into resource tree pcmcia: export resource information to sysfs pcmcia: use struct resource for PCMCIA devices, part 2 pcmcia: remove memreq_t pcmcia: move local definitions out of include/pcmcia/cs.h pcmcia: do not use io_req_t when calling pcmcia_request_io() pcmcia: do not use io_req_t after call to pcmcia_request_io() pcmcia: use struct resource for PCMCIA devices pcmcia: clean up cs.h pcmcia: use pcmica_{read,write}_config_byte pcmcia: remove cs_types.h pcmcia: remove unused flag, simplify headers pcmcia: remove obsolete CS_EVENT_ definitions pcmcia: split up central event handler pcmcia: simplify event callback pcmcia: remove obsolete ioctl Conflicts in: - drivers/staging/comedi/drivers/* - drivers/staging/wlags49_h2/wl_cs.c due to dev_info_t and whitespace changes
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/pcmciamtd.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index e699e6ac23df..e9ca5ba7d9d2 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -16,7 +16,6 @@
16#include <asm/io.h> 16#include <asm/io.h>
17#include <asm/system.h> 17#include <asm/system.h>
18 18
19#include <pcmcia/cs_types.h>
20#include <pcmcia/cs.h> 19#include <pcmcia/cs.h>
21#include <pcmcia/cistpl.h> 20#include <pcmcia/cistpl.h>
22#include <pcmcia/ds.h> 21#include <pcmcia/ds.h>
@@ -103,7 +102,7 @@ static caddr_t remap_window(struct map_info *map, unsigned long to)
103{ 102{
104 struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1; 103 struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;
105 window_handle_t win = (window_handle_t)map->map_priv_2; 104 window_handle_t win = (window_handle_t)map->map_priv_2;
106 memreq_t mrq; 105 unsigned int offset;
107 int ret; 106 int ret;
108 107
109 if (!pcmcia_dev_present(dev->p_dev)) { 108 if (!pcmcia_dev_present(dev->p_dev)) {
@@ -111,15 +110,14 @@ static caddr_t remap_window(struct map_info *map, unsigned long to)
111 return 0; 110 return 0;
112 } 111 }
113 112
114 mrq.CardOffset = to & ~(dev->win_size-1); 113 offset = to & ~(dev->win_size-1);
115 if(mrq.CardOffset != dev->offset) { 114 if (offset != dev->offset) {
116 DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x", 115 DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x",
117 dev->offset, mrq.CardOffset); 116 dev->offset, offset);
118 mrq.Page = 0; 117 ret = pcmcia_map_mem_page(dev->p_dev, win, offset);
119 ret = pcmcia_map_mem_page(dev->p_dev, win, &mrq);
120 if (ret != 0) 118 if (ret != 0)
121 return NULL; 119 return NULL;
122 dev->offset = mrq.CardOffset; 120 dev->offset = offset;
123 } 121 }
124 return dev->win_base + (to & (dev->win_size-1)); 122 return dev->win_base + (to & (dev->win_size-1));
125} 123}
@@ -346,7 +344,6 @@ static void pcmciamtd_release(struct pcmcia_device *link)
346 iounmap(dev->win_base); 344 iounmap(dev->win_base);
347 dev->win_base = NULL; 345 dev->win_base = NULL;
348 } 346 }
349 pcmcia_release_window(link, link->win);
350 } 347 }
351 pcmcia_disable_device(link); 348 pcmcia_disable_device(link);
352} 349}