Merge master.kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6

+180 -109
+4 -6
drivers/mtd/chips/cfi_cmdset_0001.c
··· 4 4 * 5 5 * (C) 2000 Red Hat. GPL'd 6 6 * 7 - * $Id: cfi_cmdset_0001.c,v 1.185 2005/11/07 11:14:22 gleixner Exp $ 7 + * $Id: cfi_cmdset_0001.c,v 1.186 2005/11/23 22:07:52 nico Exp $ 8 8 * 9 9 * 10 10 * 10/10/2000 Nicolas Pitre <nico@cam.org> ··· 644 644 * 645 645 * - contension arbitration is handled in the owner's context. 646 646 * 647 - * The 'shared' struct can be read when its lock is taken. 648 - * However any writes to it can only be made when the current 649 - * owner's lock is also held. 647 + * The 'shared' struct can be read and/or written only when 648 + * its lock is taken. 650 649 */ 651 650 struct flchip_shared *shared = chip->priv; 652 651 struct flchip *contender; ··· 674 675 } 675 676 timeo = jiffies + HZ; 676 677 spin_lock(&shared->lock); 678 + spin_unlock(contender->mutex); 677 679 } 678 680 679 681 /* We now own it */ 680 682 shared->writing = chip; 681 683 if (mode == FL_ERASING) 682 684 shared->erasing = chip; 683 - if (contender && contender != chip) 684 - spin_unlock(contender->mutex); 685 685 spin_unlock(&shared->lock); 686 686 } 687 687
+4 -4
drivers/mtd/chips/cfi_probe.c
··· 1 1 /* 2 2 Common Flash Interface probe code. 3 3 (C) 2000 Red Hat. GPL'd. 4 - $Id: cfi_probe.c,v 1.84 2005/11/07 11:14:23 gleixner Exp $ 4 + $Id: cfi_probe.c,v 1.86 2005/11/29 14:48:31 gleixner Exp $ 5 5 */ 6 6 7 7 #include <linux/config.h> ··· 230 230 cfi_send_gen_cmd(0xaa, 0x555, base, map, cfi, cfi->device_type, NULL); 231 231 cfi_send_gen_cmd(0x55, 0x2aa, base, map, cfi, cfi->device_type, NULL); 232 232 cfi_send_gen_cmd(0x90, 0x555, base, map, cfi, cfi->device_type, NULL); 233 - cfi->mfr = cfi_read_query(map, base); 234 - cfi->id = cfi_read_query(map, base + ofs_factor); 233 + cfi->mfr = cfi_read_query16(map, base); 234 + cfi->id = cfi_read_query16(map, base + ofs_factor); 235 235 236 236 /* Put it back into Read Mode */ 237 237 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); ··· 426 426 .module = THIS_MODULE 427 427 }; 428 428 429 - int __init cfi_probe_init(void) 429 + static int __init cfi_probe_init(void) 430 430 { 431 431 register_mtd_chip_driver(&cfi_chipdrv); 432 432 return 0;
+66 -57
drivers/mtd/chips/sharp.c
··· 4 4 * Copyright 2000,2001 David A. Schleef <ds@schleef.org> 5 5 * 2000,2001 Lineo, Inc. 6 6 * 7 - * $Id: sharp.c,v 1.16 2005/11/07 11:14:23 gleixner Exp $ 7 + * $Id: sharp.c,v 1.17 2005/11/29 14:28:28 gleixner Exp $ 8 8 * 9 9 * Devices supported: 10 10 * LH28F016SCT Symmetrical block flash memory, 2Mx8 ··· 160 160 return mtd; 161 161 } 162 162 163 + static inline void sharp_send_cmd(struct map_info *map, unsigned long cmd, unsigned long adr) 164 + { 165 + map_word map_cmd; 166 + map_cmd.x[0] = cmd; 167 + map_write(map, map_cmd, adr); 168 + } 169 + 163 170 static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd) 164 171 { 165 - unsigned long tmp; 172 + map_word tmp, read0, read4; 166 173 unsigned long base = 0; 167 - u32 read0, read4; 168 174 int width = 4; 169 175 170 - tmp = map_read32(map, base+0); 176 + tmp = map_read(map, base+0); 171 177 172 - map_write32(map, CMD_READ_ID, base+0); 178 + sharp_send_cmd(map, CMD_READ_ID, base+0); 173 179 174 - read0=map_read32(map, base+0); 175 - read4=map_read32(map, base+4); 176 - if(read0 == 0x89898989){ 180 + read0 = map_read(map, base+0); 181 + read4 = map_read(map, base+4); 182 + if(read0.x[0] == 0x89898989){ 177 183 printk("Looks like sharp flash\n"); 178 - switch(read4){ 184 + switch(read4.x[0]){ 179 185 case 0xaaaaaaaa: 180 186 case 0xa0a0a0a0: 181 187 /* aa - LH28F016SCT-L95 2Mx8, 32 64k blocks*/ ··· 203 197 return width; 204 198 #endif 205 199 default: 206 - printk("Sort-of looks like sharp flash, 0x%08x 0x%08x\n", 207 - read0,read4); 200 + printk("Sort-of looks like sharp flash, 0x%08lx 0x%08lx\n", 201 + read0.x[0], read4.x[0]); 208 202 } 209 - }else if((map_read32(map, base+0) == CMD_READ_ID)){ 203 + }else if((map_read(map, base+0).x[0] == CMD_READ_ID)){ 210 204 /* RAM, probably */ 211 205 printk("Looks like RAM\n"); 212 - map_write32(map, tmp, base+0); 206 + map_write(map, tmp, base+0); 213 207 }else{ 214 - printk("Doesn't look like sharp flash, 0x%08x 0x%08x\n", 215 - read0,read4); 208 + printk("Doesn't look like sharp flash, 0x%08lx 0x%08lx\n", 209 + read0.x[0], read4.x[0]); 216 210 } 217 211 218 212 return 0; ··· 221 215 /* This function returns with the chip->mutex lock held. */ 222 216 static int sharp_wait(struct map_info *map, struct flchip *chip) 223 217 { 224 - int status, i; 218 + int i; 219 + map_word status; 225 220 unsigned long timeo = jiffies + HZ; 226 221 DECLARE_WAITQUEUE(wait, current); 227 222 int adr = 0; ··· 232 225 233 226 switch(chip->state){ 234 227 case FL_READY: 235 - map_write32(map,CMD_READ_STATUS,adr); 228 + sharp_send_cmd(map, CMD_READ_STATUS, adr); 236 229 chip->state = FL_STATUS; 237 230 case FL_STATUS: 238 231 for(i=0;i<100;i++){ 239 - status = map_read32(map,adr); 240 - if((status & SR_READY)==SR_READY) 232 + status = map_read(map, adr); 233 + if((status.x[0] & SR_READY)==SR_READY) 241 234 break; 242 235 udelay(1); 243 236 } ··· 261 254 goto retry; 262 255 } 263 256 264 - map_write32(map,CMD_RESET, adr); 257 + sharp_send_cmd(map, CMD_RESET, adr); 265 258 266 259 chip->state = FL_READY; 267 260 ··· 358 351 int timeo; 359 352 int try; 360 353 int i; 361 - int status = 0; 354 + map_word data, status; 362 355 356 + status.x[0] = 0; 363 357 ret = sharp_wait(map,chip); 364 358 365 359 for(try=0;try<10;try++){ 366 - map_write32(map,CMD_BYTE_WRITE,adr); 360 + sharp_send_cmd(map, CMD_BYTE_WRITE, adr); 367 361 /* cpu_to_le32 -> hack to fix the writel be->le conversion */ 368 - map_write32(map,cpu_to_le32(datum),adr); 362 + data.x[0] = cpu_to_le32(datum); 363 + map_write(map, data, adr); 369 364 370 365 chip->state = FL_WRITING; 371 366 372 367 timeo = jiffies + (HZ/2); 373 368 374 - map_write32(map,CMD_READ_STATUS,adr); 369 + sharp_send_cmd(map, CMD_READ_STATUS, adr); 375 370 for(i=0;i<100;i++){ 376 - status = map_read32(map,adr); 377 - if((status & SR_READY)==SR_READY) 371 + status = map_read(map, adr); 372 + if((status.x[0] & SR_READY) == SR_READY) 378 373 break; 379 374 } 380 375 if(i==100){ 381 376 printk("sharp: timed out writing\n"); 382 377 } 383 378 384 - if(!(status&SR_ERRORS)) 379 + if(!(status.x[0] & SR_ERRORS)) 385 380 break; 386 381 387 - printk("sharp: error writing byte at addr=%08lx status=%08x\n",adr,status); 382 + printk("sharp: error writing byte at addr=%08lx status=%08lx\n", adr, status.x[0]); 388 383 389 - map_write32(map,CMD_CLEAR_STATUS,adr); 384 + sharp_send_cmd(map, CMD_CLEAR_STATUS, adr); 390 385 } 391 - map_write32(map,CMD_RESET,adr); 386 + sharp_send_cmd(map, CMD_RESET, adr); 392 387 chip->state = FL_READY; 393 388 394 389 wake_up(&chip->wq); ··· 443 434 { 444 435 int ret; 445 436 unsigned long timeo; 446 - int status; 437 + map_word status; 447 438 DECLARE_WAITQUEUE(wait, current); 448 439 449 - map_write32(map,CMD_READ_STATUS,adr); 450 - status = map_read32(map,adr); 440 + sharp_send_cmd(map, CMD_READ_STATUS, adr); 441 + status = map_read(map, adr); 451 442 452 443 timeo = jiffies + HZ; 453 444 454 445 while(time_before(jiffies, timeo)){ 455 - map_write32(map,CMD_READ_STATUS,adr); 456 - status = map_read32(map,adr); 457 - if((status & SR_READY)==SR_READY){ 446 + sharp_send_cmd(map, CMD_READ_STATUS, adr); 447 + status = map_read(map, adr); 448 + if((status.x[0] & SR_READY)==SR_READY){ 458 449 ret = 0; 459 450 goto out; 460 451 } ··· 485 476 { 486 477 int ret; 487 478 //int timeo; 488 - int status; 479 + map_word status; 489 480 //int i; 490 481 491 482 //printk("sharp_erase_oneblock()\n"); ··· 495 486 sharp_unlock_oneblock(map,chip,adr); 496 487 #endif 497 488 498 - map_write32(map,CMD_BLOCK_ERASE_1,adr); 499 - map_write32(map,CMD_BLOCK_ERASE_2,adr); 489 + sharp_send_cmd(map, CMD_BLOCK_ERASE_1, adr); 490 + sharp_send_cmd(map, CMD_BLOCK_ERASE_2, adr); 500 491 501 492 chip->state = FL_ERASING; 502 493 503 494 ret = sharp_do_wait_for_ready(map,chip,adr); 504 495 if(ret<0)return ret; 505 496 506 - map_write32(map,CMD_READ_STATUS,adr); 507 - status = map_read32(map,adr); 497 + sharp_send_cmd(map, CMD_READ_STATUS, adr); 498 + status = map_read(map, adr); 508 499 509 - if(!(status&SR_ERRORS)){ 510 - map_write32(map,CMD_RESET,adr); 500 + if(!(status.x[0] & SR_ERRORS)){ 501 + sharp_send_cmd(map, CMD_RESET, adr); 511 502 chip->state = FL_READY; 512 503 //spin_unlock_bh(chip->mutex); 513 504 return 0; 514 505 } 515 506 516 - printk("sharp: error erasing block at addr=%08lx status=%08x\n",adr,status); 517 - map_write32(map,CMD_CLEAR_STATUS,adr); 507 + printk("sharp: error erasing block at addr=%08lx status=%08lx\n", adr, status.x[0]); 508 + sharp_send_cmd(map, CMD_CLEAR_STATUS, adr); 518 509 519 510 //spin_unlock_bh(chip->mutex); 520 511 ··· 526 517 unsigned long adr) 527 518 { 528 519 int i; 529 - int status; 520 + map_word status; 530 521 531 - map_write32(map,CMD_CLEAR_BLOCK_LOCKS_1,adr); 532 - map_write32(map,CMD_CLEAR_BLOCK_LOCKS_2,adr); 522 + sharp_send_cmd(map, CMD_CLEAR_BLOCK_LOCKS_1, adr); 523 + sharp_send_cmd(map, CMD_CLEAR_BLOCK_LOCKS_2, adr); 533 524 534 525 udelay(100); 535 526 536 - status = map_read32(map,adr); 537 - printk("status=%08x\n",status); 527 + status = map_read(map, adr); 528 + printk("status=%08lx\n", status.x[0]); 538 529 539 530 for(i=0;i<1000;i++){ 540 - //map_write32(map,CMD_READ_STATUS,adr); 541 - status = map_read32(map,adr); 542 - if((status & SR_READY)==SR_READY) 531 + //sharp_send_cmd(map, CMD_READ_STATUS, adr); 532 + status = map_read(map, adr); 533 + if((status.x[0] & SR_READY) == SR_READY) 543 534 break; 544 535 udelay(100); 545 536 } ··· 547 538 printk("sharp: timed out unlocking block\n"); 548 539 } 549 540 550 - if(!(status&SR_ERRORS)){ 551 - map_write32(map,CMD_RESET,adr); 541 + if(!(status.x[0] & SR_ERRORS)){ 542 + sharp_send_cmd(map, CMD_RESET, adr); 552 543 chip->state = FL_READY; 553 544 return; 554 545 } 555 546 556 - printk("sharp: error unlocking block at addr=%08lx status=%08x\n",adr,status); 557 - map_write32(map,CMD_CLEAR_STATUS,adr); 547 + printk("sharp: error unlocking block at addr=%08lx status=%08lx\n", adr, status.x[0]); 548 + sharp_send_cmd(map, CMD_CLEAR_STATUS, adr); 558 549 } 559 550 #endif 560 551
+3 -3
drivers/mtd/devices/block2mtd.c
··· 1 1 /* 2 - * $Id: block2mtd.c,v 1.29 2005/11/07 11:14:24 gleixner Exp $ 2 + * $Id: block2mtd.c,v 1.30 2005/11/29 14:48:32 gleixner Exp $ 3 3 * 4 4 * block2mtd.c - create an mtd from a block device 5 5 * ··· 19 19 #include <linux/mtd/mtd.h> 20 20 #include <linux/buffer_head.h> 21 21 22 - #define VERSION "$Revision: 1.29 $" 22 + #define VERSION "$Revision: 1.30 $" 23 23 24 24 25 25 #define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args) ··· 40 40 41 41 42 42 #define PAGE_READAHEAD 64 43 - void cache_readahead(struct address_space *mapping, int index) 43 + static void cache_readahead(struct address_space *mapping, int index) 44 44 { 45 45 filler_t *filler = (filler_t*)mapping->a_ops->readpage; 46 46 int i, pagei;
+3 -3
drivers/mtd/devices/ms02-nv.c
··· 6 6 * as published by the Free Software Foundation; either version 7 7 * 2 of the License, or (at your option) any later version. 8 8 * 9 - * $Id: ms02-nv.c,v 1.10 2005/06/20 12:24:41 macro Exp $ 9 + * $Id: ms02-nv.c,v 1.11 2005/11/14 13:41:47 macro Exp $ 10 10 */ 11 11 12 12 #include <linux/init.h> ··· 293 293 294 294 switch (mips_machtype) { 295 295 case MACH_DS5000_200: 296 - csr = (volatile u32 *)KN02_CSR_BASE; 296 + csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR); 297 297 if (*csr & KN02_CSR_BNK32M) 298 298 stride = 2; 299 299 break; 300 300 case MACH_DS5000_2X0: 301 301 case MACH_DS5900: 302 - csr = (volatile u32 *)KN03_MCR_BASE; 302 + csr = (volatile u32 *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_MCR); 303 303 if (*csr & KN03_MCR_BNK32M) 304 304 stride = 2; 305 305 break;
+3 -3
drivers/mtd/ftl.c
··· 1 1 /* This version ported to the Linux-MTD system by dwmw2@infradead.org 2 - * $Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $ 2 + * $Id: ftl.c,v 1.59 2005/11/29 14:48:31 gleixner Exp $ 3 3 * 4 4 * Fixes: Arnaldo Carvalho de Melo <acme@conectiva.com.br> 5 5 * - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups ··· 1084 1084 .owner = THIS_MODULE, 1085 1085 }; 1086 1086 1087 - int init_ftl(void) 1087 + static int init_ftl(void) 1088 1088 { 1089 - DEBUG(0, "$Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $\n"); 1089 + DEBUG(0, "$Id: ftl.c,v 1.59 2005/11/29 14:48:31 gleixner Exp $\n"); 1090 1090 1091 1091 return register_mtd_blktrans(&ftl_tr); 1092 1092 }
-6
drivers/mtd/maps/Kconfig
··· 538 538 This enables access to the flash chips on the Interface MPC-1211(CTP/PCI/MPC-SH02). 539 539 If you have such a board, say 'Y'. 540 540 541 - config MTD_PQ2FADS 542 - tristate "JEDEC flash SIMM mapped on PQ2FADS and 8272ADS boards" 543 - depends on (ADS8272 || PQ2FADS) && MTD_PARTITIONS && MTD_JEDECPROBE && MTD_PHYSMAP && MTD_CFI_GEOMETRY && MTD_CFI_INTELEXT 544 - help 545 - This enables access to flash SIMM on PQ2FADS-like boards 546 - 547 541 config MTD_OMAP_NOR 548 542 tristate "TI OMAP board mappings" 549 543 depends on MTD_CFI && ARCH_OMAP
-1
drivers/mtd/maps/Makefile
··· 70 70 obj-$(CONFIG_MTD_SHARP_SL) += sharpsl-flash.o 71 71 obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o 72 72 obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o 73 - obj-$(CONFIG_MTD_PQ2FADS) += pq2fads.o 74 73 obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o 75 74 obj-$(CONFIG_MTD_TQM834x) += tqm834x.o
+66 -12
drivers/mtd/maps/ixp4xx.c
··· 1 1 /* 2 - * $Id: ixp4xx.c,v 1.12 2005/11/07 11:14:27 gleixner Exp $ 2 + * $Id: ixp4xx.c,v 1.13 2005/11/16 16:23:21 dvrabel Exp $ 3 3 * 4 4 * drivers/mtd/maps/ixp4xx.c 5 5 * ··· 34 34 35 35 #include <linux/reboot.h> 36 36 37 + /* 38 + * Read/write a 16 bit word from flash address 'addr'. 39 + * 40 + * When the cpu is in little-endian mode it swizzles the address lines 41 + * ('address coherency') so we need to undo the swizzling to ensure commands 42 + * and the like end up on the correct flash address. 43 + * 44 + * To further complicate matters, due to the way the expansion bus controller 45 + * handles 32 bit reads, the byte stream ABCD is stored on the flash as: 46 + * D15 D0 47 + * +---+---+ 48 + * | A | B | 0 49 + * +---+---+ 50 + * | C | D | 2 51 + * +---+---+ 52 + * This means that on LE systems each 16 bit word must be swapped. Note that 53 + * this requires CONFIG_MTD_CFI_BE_BYTE_SWAP to be enabled to 'unswap' the CFI 54 + * data and other flash commands which are always in D7-D0. 55 + */ 37 56 #ifndef __ARMEB__ 57 + #ifndef CONFIG_MTD_CFI_BE_BYTE_SWAP 58 + # error CONFIG_MTD_CFI_BE_BYTE_SWAP required 59 + #endif 60 + 61 + static inline u16 flash_read16(void __iomem *addr) 62 + { 63 + return be16_to_cpu(__raw_readw((void __iomem *)((unsigned long)addr ^ 0x2))); 64 + } 65 + 66 + static inline void flash_write16(u16 d, void __iomem *addr) 67 + { 68 + __raw_writew(cpu_to_be16(d), (void __iomem *)((unsigned long)addr ^ 0x2)); 69 + } 70 + 38 71 #define BYTE0(h) ((h) & 0xFF) 39 72 #define BYTE1(h) (((h) >> 8) & 0xFF) 73 + 40 74 #else 75 + 76 + static inline u16 flash_read16(const void __iomem *addr) 77 + { 78 + return __raw_readw(addr); 79 + } 80 + 81 + static inline void flash_write16(u16 d, void __iomem *addr) 82 + { 83 + __raw_writew(d, addr); 84 + } 85 + 41 86 #define BYTE0(h) (((h) >> 8) & 0xFF) 42 87 #define BYTE1(h) ((h) & 0xFF) 43 88 #endif ··· 90 45 static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs) 91 46 { 92 47 map_word val; 93 - val.x[0] = le16_to_cpu(readw(map->virt + ofs)); 48 + val.x[0] = flash_read16(map->virt + ofs); 94 49 return val; 95 50 } 96 51 ··· 102 57 static void ixp4xx_copy_from(struct map_info *map, void *to, 103 58 unsigned long from, ssize_t len) 104 59 { 105 - int i; 106 60 u8 *dest = (u8 *) to; 107 61 void __iomem *src = map->virt + from; 108 - u16 data; 109 62 110 - for (i = 0; i < (len / 2); i++) { 111 - data = le16_to_cpu(readw(src + 2*i)); 112 - dest[i * 2] = BYTE0(data); 113 - dest[i * 2 + 1] = BYTE1(data); 63 + if (len <= 0) 64 + return; 65 + 66 + if (from & 1) { 67 + *dest++ = BYTE1(flash_read16(src)); 68 + src++; 69 + --len; 114 70 } 115 71 116 - if (len & 1) 117 - dest[len - 1] = BYTE0(le16_to_cpu(readw(src + 2*i))); 72 + while (len >= 2) { 73 + u16 data = flash_read16(src); 74 + *dest++ = BYTE0(data); 75 + *dest++ = BYTE1(data); 76 + src += 2; 77 + len -= 2; 78 + } 79 + 80 + if (len > 0) 81 + *dest++ = BYTE0(flash_read16(src)); 118 82 } 119 83 120 84 /* ··· 133 79 static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long adr) 134 80 { 135 81 if (!(adr & 1)) 136 - writew(cpu_to_le16(d.x[0]), map->virt + adr); 82 + flash_write16(d.x[0], map->virt + adr); 137 83 } 138 84 139 85 /* ··· 141 87 */ 142 88 static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr) 143 89 { 144 - writew(cpu_to_le16(d.x[0]), map->virt + adr); 90 + flash_write16(d.x[0], map->virt + adr); 145 91 } 146 92 147 93 struct ixp4xx_flash_info {
+2 -2
drivers/mtd/maps/nettel.c
··· 6 6 * (C) Copyright 2000-2001, Greg Ungerer (gerg@snapgear.com) 7 7 * (C) Copyright 2001-2002, SnapGear (www.snapgear.com) 8 8 * 9 - * $Id: nettel.c,v 1.11 2005/11/07 11:14:27 gleixner Exp $ 9 + * $Id: nettel.c,v 1.12 2005/11/29 14:30:00 gleixner Exp $ 10 10 */ 11 11 12 12 /****************************************************************************/ ··· 479 479 } 480 480 if (nettel_intel_map.virt) { 481 481 iounmap(nettel_intel_map.virt); 482 - nettel_intel_map.virt = 0; 482 + nettel_intel_map.virt = NULL; 483 483 } 484 484 #endif 485 485 }
+2 -2
drivers/mtd/maps/pci.c
··· 7 7 * it under the terms of the GNU General Public License version 2 as 8 8 * published by the Free Software Foundation. 9 9 * 10 - * $Id: pci.c,v 1.13 2005/11/07 11:14:27 gleixner Exp $ 10 + * $Id: pci.c,v 1.14 2005/11/17 08:20:27 dwmw2 Exp $ 11 11 * 12 12 * Generic PCI memory map driver. We support the following boards: 13 13 * - Intel IQ80310 ATU. ··· 102 102 memcpy_toio(map->base + map->translate(map, to), from, len); 103 103 } 104 104 105 - static struct map_info mtd_pci_map = { 105 + static const struct map_info mtd_pci_map = { 106 106 .phys = NO_XIP, 107 107 .copy_from = mtd_pci_copyfrom, 108 108 .copy_to = mtd_pci_copyto,
+2 -1
drivers/mtd/maps/physmap.c
··· 1 1 /* 2 - * $Id: physmap.c,v 1.38 2005/11/07 11:14:28 gleixner Exp $ 2 + * $Id: physmap.c,v 1.39 2005/11/29 14:49:36 gleixner Exp $ 3 3 * 4 4 * Normal mappings of chips in physical memory 5 5 * ··· 19 19 #include <linux/mtd/map.h> 20 20 #include <linux/config.h> 21 21 #include <linux/mtd/partitions.h> 22 + #include <linux/mtd/physmap.h> 22 23 23 24 static struct mtd_info *mymtd; 24 25
+2 -2
drivers/mtd/maps/sc520cdp.c
··· 16 16 * along with this program; if not, write to the Free Software 17 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 18 * 19 - * $Id: sc520cdp.c,v 1.22 2005/11/07 11:14:28 gleixner Exp $ 19 + * $Id: sc520cdp.c,v 1.23 2005/11/17 08:20:27 dwmw2 Exp $ 20 20 * 21 21 * 22 22 * The SC520CDP is an evaluation board for the Elan SC520 processor available ··· 164 164 unsigned long default_address; 165 165 }; 166 166 167 - static struct sc520_par_table par_table[NUM_FLASH_BANKS] = 167 + static const struct sc520_par_table par_table[NUM_FLASH_BANKS] = 168 168 { 169 169 { /* Flash Bank #0: selected by ROMCS0 */ 170 170 SC520_PAR_ROMCS0,
+1 -1
drivers/mtd/nand/nandsim.c
··· 1486 1486 /* 1487 1487 * Module initialization function 1488 1488 */ 1489 - int __init ns_init_module(void) 1489 + static int __init ns_init_module(void) 1490 1490 { 1491 1491 struct nand_chip *chip; 1492 1492 struct nandsim *nand;
+2 -4
drivers/mtd/rfd_ftl.c
··· 30 30 31 31 #define PREFIX "rfd_ftl: " 32 32 33 - /* Major device # for FTL device */ 34 - 35 - /* A request for this major has been sent to device@lanana.org */ 33 + /* This major has been assigned by device@lanana.org */ 36 34 #ifndef RFD_FTL_MAJOR 37 - #define RFD_FTL_MAJOR 95 35 + #define RFD_FTL_MAJOR 256 38 36 #endif 39 37 40 38 /* Maximum number of partitions in an FTL region */
+2
fs/jffs2/fs.c
··· 234 234 c = JFFS2_SB_INFO(inode->i_sb); 235 235 236 236 jffs2_init_inode_info(f); 237 + down(&f->sem); 237 238 238 239 ret = jffs2_do_read_inode(c, f, inode->i_ino, &latest_node); 239 240 ··· 401 400 402 401 f = JFFS2_INODE_INFO(inode); 403 402 jffs2_init_inode_info(f); 403 + down(&f->sem); 404 404 405 405 memset(ri, 0, sizeof(*ri)); 406 406 /* Set OS-specific defaults for new inodes */
+1 -1
fs/jffs2/super.c
··· 51 51 52 52 if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == 53 53 SLAB_CTOR_CONSTRUCTOR) { 54 - init_MUTEX_LOCKED(&ei->sem); 54 + init_MUTEX(&ei->sem); 55 55 inode_init_once(&ei->vfs_inode); 56 56 } 57 57 }
+17 -1
include/linux/mtd/cfi.h
··· 1 1 2 2 /* Common Flash Interface structures 3 3 * See http://support.intel.com/design/flash/technote/index.htm 4 - * $Id: cfi.h,v 1.56 2005/11/07 11:14:54 gleixner Exp $ 4 + * $Id: cfi.h,v 1.57 2005/11/15 23:28:17 tpoynor Exp $ 5 5 */ 6 6 7 7 #ifndef __MTD_CFI_H__ ··· 416 416 417 417 if (map_bankwidth_is_1(map)) { 418 418 return val.x[0]; 419 + } else if (map_bankwidth_is_2(map)) { 420 + return cfi16_to_cpu(val.x[0]); 421 + } else { 422 + /* No point in a 64-bit byteswap since that would just be 423 + swapping the responses from different chips, and we are 424 + only interested in one chip (a representative sample) */ 425 + return cfi32_to_cpu(val.x[0]); 426 + } 427 + } 428 + 429 + static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr) 430 + { 431 + map_word val = map_read(map, addr); 432 + 433 + if (map_bankwidth_is_1(map)) { 434 + return val.x[0] & 0xff; 419 435 } else if (map_bankwidth_is_2(map)) { 420 436 return cfi16_to_cpu(val.x[0]); 421 437 } else {