aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/afs.c16
-rw-r--r--drivers/mtd/maps/pcmciamtd.c7
2 files changed, 3 insertions, 20 deletions
diff --git a/drivers/mtd/afs.c b/drivers/mtd/afs.c
index 801e6c7d0892..7363e101eb0f 100644
--- a/drivers/mtd/afs.c
+++ b/drivers/mtd/afs.c
@@ -219,7 +219,7 @@ static int parse_afs_partitions(struct mtd_info *mtd,
219 */ 219 */
220 for (idx = off = 0; off < mtd->size; off += mtd->erasesize) { 220 for (idx = off = 0; off < mtd->size; off += mtd->erasesize) {
221 struct image_info_struct iis; 221 struct image_info_struct iis;
222 u_int iis_ptr, img_ptr, size; 222 u_int iis_ptr, img_ptr;
223 223
224 /* Read the footer. */ 224 /* Read the footer. */
225 ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask); 225 ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask);
@@ -236,21 +236,9 @@ static int parse_afs_partitions(struct mtd_info *mtd,
236 continue; 236 continue;
237 237
238 strcpy(str, iis.name); 238 strcpy(str, iis.name);
239 size = mtd->erasesize + off - img_ptr;
240
241 /*
242 * In order to support JFFS2 partitions on this layout,
243 * we must lie to MTD about the real size of JFFS2
244 * partitions; this ensures that the AFS flash footer
245 * won't be erased by JFFS2. Please ensure that your
246 * JFFS2 partitions are given image numbers between
247 * 1000 and 2000 inclusive.
248 */
249 if (iis.imageNumber >= 1000 && iis.imageNumber < 2000)
250 size -= mtd->erasesize;
251 239
252 parts[idx].name = str; 240 parts[idx].name = str;
253 parts[idx].size = size; 241 parts[idx].size = (iis.length + mtd->erasesize - 1) & ~(mtd->erasesize - 1);
254 parts[idx].offset = img_ptr; 242 parts[idx].offset = img_ptr;
255 parts[idx].mask_flags = 0; 243 parts[idx].mask_flags = 0;
256 244
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index c2655a817e3d..ff7c50d10180 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -18,7 +18,6 @@
18#include <asm/io.h> 18#include <asm/io.h>
19#include <asm/system.h> 19#include <asm/system.h>
20 20
21#include <pcmcia/version.h>
22#include <pcmcia/cs_types.h> 21#include <pcmcia/cs_types.h>
23#include <pcmcia/cs.h> 22#include <pcmcia/cs.h>
24#include <pcmcia/cistpl.h> 23#include <pcmcia/cistpl.h>
@@ -800,11 +799,6 @@ static dev_link_t *pcmciamtd_attach(void)
800 799
801 /* Register with Card Services */ 800 /* Register with Card Services */
802 client_reg.dev_info = &dev_info; 801 client_reg.dev_info = &dev_info;
803 client_reg.EventMask =
804 CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
805 CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
806 CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
807 client_reg.event_handler = &pcmciamtd_event;
808 client_reg.Version = 0x0210; 802 client_reg.Version = 0x0210;
809 client_reg.event_callback_args.client_data = link; 803 client_reg.event_callback_args.client_data = link;
810 DEBUG(2, "Calling RegisterClient"); 804 DEBUG(2, "Calling RegisterClient");
@@ -850,6 +844,7 @@ static struct pcmcia_driver pcmciamtd_driver = {
850 .name = "pcmciamtd" 844 .name = "pcmciamtd"
851 }, 845 },
852 .attach = pcmciamtd_attach, 846 .attach = pcmciamtd_attach,
847 .event = pcmciamtd_event,
853 .detach = pcmciamtd_detach, 848 .detach = pcmciamtd_detach,
854 .owner = THIS_MODULE, 849 .owner = THIS_MODULE,
855 .id_table = pcmciamtd_ids, 850 .id_table = pcmciamtd_ids,