Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[MTD] devices: Clean up trailing white spaces

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Thomas Gleixner and committed by
Thomas Gleixner
e5580fbe 69f34c98

+155 -155
+4 -4
drivers/mtd/devices/Kconfig
··· 1 1 # drivers/mtd/maps/Kconfig 2 - # $Id: Kconfig,v 1.15 2004/12/22 17:51:15 joern Exp $ 2 + # $Id: Kconfig,v 1.18 2005/11/07 11:14:24 gleixner Exp $ 3 3 4 4 menu "Self-contained MTD device drivers" 5 5 depends on MTD!=n ··· 110 110 If you have system RAM accessible by the CPU but not used by Linux 111 111 in normal operation, you can give the physical address at which the 112 112 available RAM starts, and the MTDRAM driver will use it instead of 113 - allocating space from Linux's available memory. Otherwise, leave 113 + allocating space from Linux's available memory. Otherwise, leave 114 114 this set to zero. Most people will want to leave this as zero. 115 115 116 116 config MTD_BLKMTD ··· 165 165 select MTD_DOCPROBE 166 166 select MTD_NAND_IDS 167 167 ---help--- 168 - This provides an alternative MTD device driver for the M-Systems 168 + This provides an alternative MTD device driver for the M-Systems 169 169 DiskOnChip Millennium devices. Use this if you have problems with 170 170 the combined DiskOnChip 2000 and Millennium driver above. To get 171 171 the DiskOnChip probe code to load and use this driver instead of ··· 192 192 193 193 If you use this device, you probably also want to enable the INFTL 194 194 'Inverse NAND Flash Translation Layer' option below, which is used 195 - to emulate a block device by using a kind of file system on the 195 + to emulate a block device by using a kind of file system on the 196 196 flash chips. 197 197 198 198 NOTE: This driver will soon be replaced by the new DiskOnChip driver
+5 -5
drivers/mtd/devices/blkmtd.c
··· 1 1 /* 2 - * $Id: blkmtd.c,v 1.24 2004/11/16 18:29:01 dwmw2 Exp $ 2 + * $Id: blkmtd.c,v 1.27 2005/11/07 11:14:24 gleixner Exp $ 3 3 * 4 4 * blkmtd.c - use a block device as a fake MTD 5 5 * ··· 39 39 40 40 /* Default erase size in K, always make it a multiple of PAGE_SIZE */ 41 41 #define CONFIG_MTD_BLKDEV_ERASESIZE (128 << 10) /* 128KiB */ 42 - #define VERSION "$Revision: 1.24 $" 42 + #define VERSION "$Revision: 1.27 $" 43 43 44 44 /* Info for the block device */ 45 45 struct blkmtd_dev { ··· 117 117 unlock_page(page); 118 118 page_cache_release(page); 119 119 } while (bvec >= bio->bi_io_vec); 120 - 120 + 121 121 complete((struct completion*)bio->bi_private); 122 122 return 0; 123 123 } ··· 135 135 unlock_page(page); 136 136 return 0; 137 137 } 138 - 138 + 139 139 ClearPageUptodate(page); 140 140 ClearPageError(page); 141 141 ··· 710 710 dev->mtd_info.erasesize >> 10, 711 711 readonly ? "(read-only)" : ""); 712 712 } 713 - 713 + 714 714 return dev; 715 715 716 716 devinit_err:
+4 -4
drivers/mtd/devices/block2mtd.c
··· 1 1 /* 2 - * $Id: block2mtd.c,v 1.28 2005/03/19 22:40:44 gleixner Exp $ 2 + * $Id: block2mtd.c,v 1.29 2005/11/07 11:14:24 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.28 $" 22 + #define VERSION "$Revision: 1.29 $" 23 23 24 24 25 25 #define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args) ··· 111 111 return PTR_ERR(page); 112 112 113 113 max = (u_long*)page_address(page) + PAGE_SIZE; 114 - for (p=(u_long*)page_address(page); p<max; p++) 114 + for (p=(u_long*)page_address(page); p<max; p++) 115 115 if (*p != -1UL) { 116 116 lock_page(page); 117 117 memset(page_address(page), 0xff, PAGE_SIZE); ··· 206 206 if (retlen) 207 207 *retlen = 0; 208 208 while (len) { 209 - if ((offset+len) > PAGE_SIZE) 209 + if ((offset+len) > PAGE_SIZE) 210 210 cpylen = PAGE_SIZE - offset; // multiple pages 211 211 else 212 212 cpylen = len; // this page
+21 -21
drivers/mtd/devices/doc2000.c
··· 4 4 * (c) 1999 Machine Vision Holdings, Inc. 5 5 * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> 6 6 * 7 - * $Id: doc2000.c,v 1.66 2005/01/05 18:05:12 dwmw2 Exp $ 7 + * $Id: doc2000.c,v 1.67 2005/11/07 11:14:24 gleixner Exp $ 8 8 */ 9 9 10 10 #include <linux/kernel.h> ··· 58 58 size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); 59 59 static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, 60 60 size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); 61 - static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, 61 + static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, 62 62 unsigned long count, loff_t to, size_t *retlen, 63 63 u_char *eccbuf, struct nand_oobinfo *oobsel); 64 64 static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len, ··· 76 76 { 77 77 volatile char dummy; 78 78 int i; 79 - 79 + 80 80 for (i = 0; i < cycles; i++) { 81 81 if (DoC_is_Millennium(doc)) 82 82 dummy = ReadDOC(doc->virtadr, NOP); 83 83 else 84 84 dummy = ReadDOC(doc->virtadr, DOCStatus); 85 85 } 86 - 86 + 87 87 } 88 88 89 89 /* DOC_WaitReady: Wait for RDY line to be asserted by the flash chip */ ··· 220 220 WriteDOC(ofs & 0xff, docptr, WritePipeTerm); 221 221 222 222 DoC_Delay(doc, 2); /* Needed for some slow flash chips. mf. */ 223 - 224 - /* FIXME: The SlowIO's for millennium could be replaced by 223 + 224 + /* FIXME: The SlowIO's for millennium could be replaced by 225 225 a single WritePipeTerm here. mf. */ 226 226 227 227 /* Lower the ALE line */ ··· 377 377 if (mfr == 0xff || mfr == 0) 378 378 return 0; 379 379 380 - /* Check it's the same as the first chip we identified. 380 + /* Check it's the same as the first chip we identified. 381 381 * M-Systems say that any given DiskOnChip device should only 382 - * contain _one_ type of flash part, although that's not a 382 + * contain _one_ type of flash part, although that's not a 383 383 * hardware restriction. */ 384 384 if (doc->mfr) { 385 385 if (doc->mfr == mfr && doc->id == id) ··· 397 397 for (j = 0; nand_manuf_ids[j].id != 0x0; j++) { 398 398 if (nand_manuf_ids[j].id == mfr) 399 399 break; 400 - } 400 + } 401 401 printk(KERN_INFO 402 402 "Flash chip found: Manufacturer ID: %2.2X, " 403 403 "Chip ID: %2.2X (%s:%s)\n", mfr, id, ··· 405 405 if (!doc->mfr) { 406 406 doc->mfr = mfr; 407 407 doc->id = id; 408 - doc->chipshift = 408 + doc->chipshift = 409 409 ffs((nand_flash_ids[i].chipsize << 20)) - 1; 410 410 doc->page256 = (nand_flash_ids[i].pagesize == 256) ? 1 : 0; 411 411 doc->pageadrlen = doc->chipshift > 25 ? 3 : 2; ··· 467 467 468 468 ret = 0; 469 469 470 - /* Fill out the chip array with {floor, chipno} for each 470 + /* Fill out the chip array with {floor, chipno} for each 471 471 * detected chip in the device. */ 472 472 for (floor = 0; floor < MAX_FLOORS; floor++) { 473 473 for (chip = 0; chip < numchips[floor]; chip++) { ··· 757 757 (long)from, eccbuf[0], eccbuf[1], eccbuf[2], 758 758 eccbuf[3], eccbuf[4], eccbuf[5]); 759 759 #endif 760 - 760 + 761 761 /* disable the ECC engine */ 762 762 WriteDOC(DOC_ECC_DIS, docptr , ECCConf); 763 763 } 764 764 765 - /* according to 11.4.1, we need to wait for the busy line 765 + /* according to 11.4.1, we need to wait for the busy line 766 766 * drop if we read to the end of the page. */ 767 767 if(0 == ((from + len) & 0x1ff)) 768 768 { ··· 941 941 942 942 /* Let the caller know we completed it */ 943 943 *retlen += len; 944 - 944 + 945 945 if (eccbuf) { 946 946 unsigned char x[8]; 947 947 size_t dummy; ··· 950 950 /* Write the ECC data to flash */ 951 951 for (di=0; di<6; di++) 952 952 x[di] = eccbuf[di]; 953 - 953 + 954 954 x[6]=0x55; 955 955 x[7]=0x55; 956 - 956 + 957 957 ret = doc_write_oob_nolock(mtd, to, 8, &dummy, x); 958 958 if (ret) { 959 959 up(&this->lock); ··· 970 970 return 0; 971 971 } 972 972 973 - static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, 973 + static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, 974 974 unsigned long count, loff_t to, size_t *retlen, 975 975 u_char *eccbuf, struct nand_oobinfo *oobsel) 976 976 { ··· 1022 1022 break; 1023 1023 1024 1024 to += thislen; 1025 - } 1025 + } 1026 1026 1027 1027 up(&writev_buf_sem); 1028 1028 *retlen = totretlen; ··· 1080 1080 /* Reading the full OOB data drops us off of the end of the page, 1081 1081 * causing the flash device to go into busy mode, so we need 1082 1082 * to wait until ready 11.4.1 and Toshiba TC58256FT docs */ 1083 - 1083 + 1084 1084 ret = DoC_WaitReady(this); 1085 1085 1086 1086 up(&this->lock); ··· 1190 1190 return 0; 1191 1191 1192 1192 } 1193 - 1193 + 1194 1194 static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len, 1195 1195 size_t * retlen, const u_char * buf) 1196 1196 { ··· 1222 1222 } 1223 1223 1224 1224 instr->state = MTD_ERASING; 1225 - 1225 + 1226 1226 /* FIXME: Do this in the background. Use timers or schedule_task() */ 1227 1227 while(len) { 1228 1228 mychip = &this->chips[ofs >> this->chipshift];
+12 -12
drivers/mtd/devices/doc2001.c
··· 4 4 * (c) 1999 Machine Vision Holdings, Inc. 5 5 * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> 6 6 * 7 - * $Id: doc2001.c,v 1.48 2005/01/05 18:05:12 dwmw2 Exp $ 7 + * $Id: doc2001.c,v 1.49 2005/11/07 11:14:24 gleixner Exp $ 8 8 */ 9 9 10 10 #include <linux/kernel.h> ··· 196 196 DoC_Command(doc->virtadr, NAND_CMD_RESET, CDSN_CTRL_WP); 197 197 DoC_WaitReady(doc->virtadr); 198 198 199 - /* Read the NAND chip ID: 1. Send ReadID command */ 199 + /* Read the NAND chip ID: 1. Send ReadID command */ 200 200 DoC_Command(doc->virtadr, NAND_CMD_READID, CDSN_CTRL_WP); 201 201 202 - /* Read the NAND chip ID: 2. Send address byte zero */ 202 + /* Read the NAND chip ID: 2. Send address byte zero */ 203 203 DoC_Address(doc->virtadr, 1, 0x00, CDSN_CTRL_WP, 0x00); 204 204 205 205 /* Read the manufacturer and device id codes of the flash device through ··· 223 223 for (j = 0; nand_manuf_ids[j].id != 0x0; j++) { 224 224 if (nand_manuf_ids[j].id == mfr) 225 225 break; 226 - } 226 + } 227 227 printk(KERN_INFO "Flash chip found: Manufacturer ID: %2.2X, " 228 228 "Chip ID: %2.2X (%s:%s)\n", 229 229 mfr, id, nand_manuf_ids[j].name, nand_flash_ids[i].name); ··· 275 275 return; 276 276 } 277 277 278 - /* Fill out the chip array with {floor, chipno} for each 278 + /* Fill out the chip array with {floor, chipno} for each 279 279 * detected chip in the device. */ 280 280 for (floor = 0, ret = 0; floor < MAX_FLOORS_MIL; floor++) { 281 281 for (chip = 0 ; chip < numchips[floor] ; chip++) { ··· 309 309 tmp2 = ReadDOC(doc2->virtadr, AliasResolution); 310 310 if (tmp1 != tmp2) 311 311 return 0; 312 - 312 + 313 313 WriteDOC((tmp1+1) % 0xff, doc1->virtadr, AliasResolution); 314 314 tmp2 = ReadDOC(doc2->virtadr, AliasResolution); 315 315 if (tmp2 == (tmp1+1) % 0xff) ··· 425 425 return -EINVAL; 426 426 427 427 /* Don't allow a single read to cross a 512-byte block boundary */ 428 - if (from + len > ((from | 0x1ff) + 1)) 428 + if (from + len > ((from | 0x1ff) + 1)) 429 429 len = ((from | 0x1ff) + 1) - from; 430 430 431 431 /* Find the chip which is to be used and select it */ ··· 552 552 553 553 #if 0 554 554 /* Don't allow a single write to cross a 512-byte block boundary */ 555 - if (to + len > ( (to | 0x1ff) + 1)) 555 + if (to + len > ( (to | 0x1ff) + 1)) 556 556 len = ((to | 0x1ff) + 1) - to; 557 557 #else 558 558 /* Don't allow writes which aren't exactly one block */ ··· 632 632 633 633 /* write the block status BLOCK_USED (0x5555) at the end of ECC data 634 634 FIXME: this is only a hack for programming the IPL area for LinuxBIOS 635 - and should be replace with proper codes in user space utilities */ 635 + and should be replace with proper codes in user space utilities */ 636 636 WriteDOC(0x55, docptr, Mil_CDSN_IO); 637 637 WriteDOC(0x55, docptr, Mil_CDSN_IO + 1); 638 638 ··· 802 802 void __iomem *docptr = this->virtadr; 803 803 struct Nand *mychip = &this->chips[ofs >> this->chipshift]; 804 804 805 - if (len != mtd->erasesize) 805 + if (len != mtd->erasesize) 806 806 printk(KERN_WARNING "Erase not right size (%x != %x)n", 807 807 len, mtd->erasesize); 808 808 ··· 870 870 while ((mtd=docmillist)) { 871 871 this = mtd->priv; 872 872 docmillist = this->nextdoc; 873 - 873 + 874 874 del_mtd_device(mtd); 875 - 875 + 876 876 iounmap(this->virtadr); 877 877 kfree(this->chips); 878 878 kfree(mtd);
+10 -10
drivers/mtd/devices/doc2001plus.c
··· 6 6 * (c) 1999 Machine Vision Holdings, Inc. 7 7 * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> 8 8 * 9 - * $Id: doc2001plus.c,v 1.13 2005/01/05 18:05:12 dwmw2 Exp $ 9 + * $Id: doc2001plus.c,v 1.14 2005/11/07 11:14:24 gleixner Exp $ 10 10 * 11 11 * Released under GPL 12 12 */ ··· 293 293 DoC_Command(docptr, NAND_CMD_RESET, 0); 294 294 DoC_WaitReady(docptr); 295 295 296 - /* Read the NAND chip ID: 1. Send ReadID command */ 296 + /* Read the NAND chip ID: 1. Send ReadID command */ 297 297 DoC_Command(docptr, NAND_CMD_READID, 0); 298 298 299 - /* Read the NAND chip ID: 2. Send address byte zero */ 299 + /* Read the NAND chip ID: 2. Send address byte zero */ 300 300 DoC_Address(doc, 1, 0x00, 0, 0x00); 301 301 302 302 WriteDOC(0, docptr, Mplus_FlashControl); ··· 365 365 this->interleave = 1; 366 366 367 367 /* Check the ASIC agrees */ 368 - if ( (this->interleave << 2) != 368 + if ( (this->interleave << 2) != 369 369 (ReadDOC(this->virtadr, Mplus_Configuration) & 4)) { 370 370 u_char conf = ReadDOC(this->virtadr, Mplus_Configuration); 371 371 printk(KERN_NOTICE "Setting DiskOnChip Millennium Plus interleave to %s\n", ··· 398 398 return; 399 399 } 400 400 401 - /* Fill out the chip array with {floor, chipno} for each 401 + /* Fill out the chip array with {floor, chipno} for each 402 402 * detected chip in the device. */ 403 403 for (floor = 0, ret = 0; floor < MAX_FLOORS_MPLUS; floor++) { 404 404 for (chip = 0 ; chip < numchips[floor] ; chip++) { ··· 432 432 tmp2 = ReadDOC(doc2->virtadr, Mplus_AliasResolution); 433 433 if (tmp1 != tmp2) 434 434 return 0; 435 - 435 + 436 436 WriteDOC((tmp1+1) % 0xff, doc1->virtadr, Mplus_AliasResolution); 437 437 tmp2 = ReadDOC(doc2->virtadr, Mplus_AliasResolution); 438 438 if (tmp2 == (tmp1+1) % 0xff) ··· 624 624 return -EINVAL; 625 625 626 626 /* Don't allow a single read to cross a 512-byte block boundary */ 627 - if (from + len > ((from | 0x1ff) + 1)) 627 + if (from + len > ((from | 0x1ff) + 1)) 628 628 len = ((from | 0x1ff) + 1) - from; 629 629 630 630 DoC_CheckASIC(docptr); ··· 1066 1066 1067 1067 DoC_CheckASIC(docptr); 1068 1068 1069 - if (len != mtd->erasesize) 1069 + if (len != mtd->erasesize) 1070 1070 printk(KERN_WARNING "MTD: Erase not right size (%x != %x)n", 1071 1071 len, mtd->erasesize); 1072 1072 ··· 1136 1136 while ((mtd=docmilpluslist)) { 1137 1137 this = mtd->priv; 1138 1138 docmilpluslist = this->nextdoc; 1139 - 1139 + 1140 1140 del_mtd_device(mtd); 1141 - 1141 + 1142 1142 iounmap(this->virtadr); 1143 1143 kfree(this->chips); 1144 1144 kfree(mtd);
+20 -20
drivers/mtd/devices/docecc.c
··· 4 4 * GNU GPL License. The rest is simply to convert the disk on chip 5 5 * syndrom into a standard syndom. 6 6 * 7 - * Author: Fabrice Bellard (fabrice.bellard@netgem.com) 7 + * Author: Fabrice Bellard (fabrice.bellard@netgem.com) 8 8 * Copyright (C) 2000 Netgem S.A. 9 9 * 10 - * $Id: docecc.c,v 1.5 2003/05/21 15:15:06 dwmw2 Exp $ 10 + * $Id: docecc.c,v 1.7 2005/11/07 11:14:25 gleixner Exp $ 11 11 * 12 12 * This program is free software; you can redistribute it and/or modify 13 13 * it under the terms of the GNU General Public License as published by ··· 122 122 a(0) + a(1) @ + a(2) @^2 + ... + a(m-1) @^(m-1) 123 123 we consider the integer "i" whose binary representation with a(0) being LSB 124 124 and a(m-1) MSB is (a(0),a(1),...,a(m-1)) and locate the entry 125 - "index_of[i]". Now, @^index_of[i] is that element whose polynomial 125 + "index_of[i]". Now, @^index_of[i] is that element whose polynomial 126 126 representation is (a(0),a(1),a(2),...,a(m-1)). 127 127 NOTE: 128 128 The element alpha_to[2^m-1] = 0 always signifying that the ··· 130 130 Similarily, the element index_of[0] = A0 always signifying 131 131 that the power of alpha which has the polynomial representation 132 132 (0,0,...,0) is "infinity". 133 - 133 + 134 134 */ 135 135 136 136 static void ··· 176 176 * are written back. NOTE! This array must be at least NN-KK elements long. 177 177 * The corrected data are written in eras_val[]. They must be xor with the data 178 178 * to retrieve the correct data : data[erase_pos[i]] ^= erase_val[i] . 179 - * 179 + * 180 180 * First "no_eras" erasures are declared by the calling program. Then, the 181 181 * maximum # of errors correctable is t_after_eras = floor((NN-KK-no_eras)/2). 182 182 * If the number of channel errors is not greater than "t_after_eras" the ··· 189 189 * */ 190 190 static int 191 191 eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], 192 - gf bb[NN - KK + 1], gf eras_val[NN-KK], int eras_pos[NN-KK], 192 + gf bb[NN - KK + 1], gf eras_val[NN-KK], int eras_pos[NN-KK], 193 193 int no_eras) 194 194 { 195 195 int deg_lambda, el, deg_omega; ··· 212 212 count = 0; 213 213 goto finish; 214 214 } 215 - 215 + 216 216 for(i=1;i<=NN-KK;i++){ 217 217 s[i] = bb[0]; 218 218 } ··· 220 220 if(bb[j] == 0) 221 221 continue; 222 222 tmp = Index_of[bb[j]]; 223 - 223 + 224 224 for(i=1;i<=NN-KK;i++) 225 225 s[i] ^= Alpha_to[modnn(tmp + (B0+i-1)*PRIM*j)]; 226 226 } ··· 234 234 tmp = modnn(tmp + 2 * KK * (B0+i-1)*PRIM); 235 235 s[i] = tmp; 236 236 } 237 - 237 + 238 238 CLEAR(&lambda[1],NN-KK); 239 239 lambda[0] = 1; 240 240 ··· 252 252 #if DEBUG_ECC >= 1 253 253 /* Test code that verifies the erasure locator polynomial just constructed 254 254 Needed only for decoder debugging. */ 255 - 255 + 256 256 /* find roots of the erasure location polynomial */ 257 257 for(i=1;i<=no_eras;i++) 258 258 reg[i] = Index_of[lambda[i]]; ··· 286 286 } 287 287 for(i=0;i<NN-KK+1;i++) 288 288 b[i] = Index_of[lambda[i]]; 289 - 289 + 290 290 /* 291 291 * Begin Berlekamp-Massey algorithm to determine error+erasure 292 292 * locator polynomial ··· 389 389 omega[i] = Index_of[tmp]; 390 390 } 391 391 omega[NN-KK] = A0; 392 - 392 + 393 393 /* 394 394 * Compute error values in poly-form. num1 = omega(inv(X(l))), num2 = 395 395 * inv(X(l))**(B0-1) and den = lambda_pr(inv(X(l))) all in poly-form ··· 402 402 } 403 403 num2 = Alpha_to[modnn(root[j] * (B0 - 1) + NN)]; 404 404 den = 0; 405 - 405 + 406 406 /* lambda[i+1] for i even is the formal derivative lambda_pr of lambda[i] */ 407 407 for (i = min(deg_lambda,NN-KK-1) & ~1; i >= 0; i -=2) { 408 408 if(lambda[i+1] != A0) ··· 436 436 /* The sector bytes are packed into NB_DATA MM bits words */ 437 437 #define NB_DATA (((SECTOR_SIZE + 1) * 8 + 6) / MM) 438 438 439 - /* 439 + /* 440 440 * Correct the errors in 'sector[]' by using 'ecc1[]' which is the 441 441 * content of the feedback shift register applyied to the sector and 442 442 * the ECC. Return the number of errors corrected (and correct them in 443 - * sector), or -1 if error 443 + * sector), or -1 if error 444 444 */ 445 445 int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6]) 446 446 { ··· 454 454 Alpha_to = kmalloc((NN + 1) * sizeof(dtype), GFP_KERNEL); 455 455 if (!Alpha_to) 456 456 return -1; 457 - 457 + 458 458 Index_of = kmalloc((NN + 1) * sizeof(dtype), GFP_KERNEL); 459 459 if (!Index_of) { 460 460 kfree(Alpha_to); ··· 470 470 bb[2] = ((ecc1[2] & 0xf0) >> 4) | ((ecc1[3] & 0x3f) << 4); 471 471 bb[3] = ((ecc1[3] & 0xc0) >> 6) | ((ecc1[0] & 0xff) << 2); 472 472 473 - nb_errors = eras_dec_rs(Alpha_to, Index_of, bb, 473 + nb_errors = eras_dec_rs(Alpha_to, Index_of, bb, 474 474 error_val, error_pos, 0); 475 475 if (nb_errors <= 0) 476 476 goto the_end; ··· 489 489 can be modified since pos is even */ 490 490 index = (pos >> 3) ^ 1; 491 491 bitpos = pos & 7; 492 - if ((index >= 0 && index < SECTOR_SIZE) || 492 + if ((index >= 0 && index < SECTOR_SIZE) || 493 493 index == (SECTOR_SIZE + 1)) { 494 494 val = error_val[i] >> (2 + bitpos); 495 495 parity ^= val; ··· 500 500 bitpos = (bitpos + 10) & 7; 501 501 if (bitpos == 0) 502 502 bitpos = 8; 503 - if ((index >= 0 && index < SECTOR_SIZE) || 503 + if ((index >= 0 && index < SECTOR_SIZE) || 504 504 index == (SECTOR_SIZE + 1)) { 505 505 val = error_val[i] << (8 - bitpos); 506 506 parity ^= val; ··· 509 509 } 510 510 } 511 511 } 512 - 512 + 513 513 /* use parity to test extra errors */ 514 514 if ((parity & 0xff) != 0) 515 515 nb_errors = -1;
+41 -41
drivers/mtd/devices/docprobe.c
··· 4 4 /* (C) 1999 Machine Vision Holdings, Inc. */ 5 5 /* (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> */ 6 6 7 - /* $Id: docprobe.c,v 1.44 2005/01/05 12:40:36 dwmw2 Exp $ */ 7 + /* $Id: docprobe.c,v 1.46 2005/11/07 11:14:25 gleixner Exp $ */ 8 8 9 9 10 10 11 11 /* DOC_PASSIVE_PROBE: 12 - In order to ensure that the BIOS checksum is correct at boot time, and 13 - hence that the onboard BIOS extension gets executed, the DiskOnChip 14 - goes into reset mode when it is read sequentially: all registers 15 - return 0xff until the chip is woken up again by writing to the 16 - DOCControl register. 12 + In order to ensure that the BIOS checksum is correct at boot time, and 13 + hence that the onboard BIOS extension gets executed, the DiskOnChip 14 + goes into reset mode when it is read sequentially: all registers 15 + return 0xff until the chip is woken up again by writing to the 16 + DOCControl register. 17 17 18 - Unfortunately, this means that the probe for the DiskOnChip is unsafe, 19 - because one of the first things it does is write to where it thinks 20 - the DOCControl register should be - which may well be shared memory 21 - for another device. I've had machines which lock up when this is 22 - attempted. Hence the possibility to do a passive probe, which will fail 18 + Unfortunately, this means that the probe for the DiskOnChip is unsafe, 19 + because one of the first things it does is write to where it thinks 20 + the DOCControl register should be - which may well be shared memory 21 + for another device. I've had machines which lock up when this is 22 + attempted. Hence the possibility to do a passive probe, which will fail 23 23 to detect a chip in reset mode, but is at least guaranteed not to lock 24 24 the machine. 25 25 ··· 33 33 34 34 The old Millennium-only driver has been retained just in case there 35 35 are problems with the new code. If the combined driver doesn't work 36 - for you, you can try the old one by undefining DOC_SINGLE_DRIVER 36 + for you, you can try the old one by undefining DOC_SINGLE_DRIVER 37 37 below and also enabling it in your configuration. If this fixes the 38 - problems, please send a report to the MTD mailing list at 38 + problems, please send a report to the MTD mailing list at 39 39 <linux-mtd@lists.infradead.org>. 40 40 */ 41 41 #define DOC_SINGLE_DRIVER ··· 68 68 static unsigned long __initdata doc_locations[] = { 69 69 #if defined (__alpha__) || defined(__i386__) || defined(__x86_64__) 70 70 #ifdef CONFIG_MTD_DOCPROBE_HIGH 71 - 0xfffc8000, 0xfffca000, 0xfffcc000, 0xfffce000, 71 + 0xfffc8000, 0xfffca000, 0xfffcc000, 0xfffce000, 72 72 0xfffd0000, 0xfffd2000, 0xfffd4000, 0xfffd6000, 73 - 0xfffd8000, 0xfffda000, 0xfffdc000, 0xfffde000, 74 - 0xfffe0000, 0xfffe2000, 0xfffe4000, 0xfffe6000, 73 + 0xfffd8000, 0xfffda000, 0xfffdc000, 0xfffde000, 74 + 0xfffe0000, 0xfffe2000, 0xfffe4000, 0xfffe6000, 75 75 0xfffe8000, 0xfffea000, 0xfffec000, 0xfffee000, 76 76 #else /* CONFIG_MTD_DOCPROBE_HIGH */ 77 - 0xc8000, 0xca000, 0xcc000, 0xce000, 77 + 0xc8000, 0xca000, 0xcc000, 0xce000, 78 78 0xd0000, 0xd2000, 0xd4000, 0xd6000, 79 - 0xd8000, 0xda000, 0xdc000, 0xde000, 80 - 0xe0000, 0xe2000, 0xe4000, 0xe6000, 79 + 0xd8000, 0xda000, 0xdc000, 0xde000, 80 + 0xe0000, 0xe2000, 0xe4000, 0xe6000, 81 81 0xe8000, 0xea000, 0xec000, 0xee000, 82 82 #endif /* CONFIG_MTD_DOCPROBE_HIGH */ 83 83 #elif defined(__PPC__) ··· 111 111 return 0; 112 112 #endif /* CONFIG_MTD_DOCPROBE_55AA */ 113 113 114 - #ifndef DOC_PASSIVE_PROBE 114 + #ifndef DOC_PASSIVE_PROBE 115 115 /* It's not possible to cleanly detect the DiskOnChip - the 116 116 * bootup procedure will put the device into reset mode, and 117 117 * it's not possible to talk to it without actually writing 118 118 * to the DOCControl register. So we store the current contents 119 119 * of the DOCControl register's location, in case we later decide 120 120 * that it's not a DiskOnChip, and want to put it back how we 121 - * found it. 121 + * found it. 122 122 */ 123 123 tmp2 = ReadDOC(window, DOCControl); 124 - 124 + 125 125 /* Reset the DiskOnChip ASIC */ 126 - WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, 126 + WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, 127 127 window, DOCControl); 128 - WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, 128 + WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, 129 129 window, DOCControl); 130 - 130 + 131 131 /* Enable the DiskOnChip ASIC */ 132 - WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, 132 + WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, 133 133 window, DOCControl); 134 - WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, 134 + WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, 135 135 window, DOCControl); 136 - #endif /* !DOC_PASSIVE_PROBE */ 136 + #endif /* !DOC_PASSIVE_PROBE */ 137 137 138 138 /* We need to read the ChipID register four times. For some 139 139 newer DiskOnChip 2000 units, the first three reads will 140 140 return the DiskOnChip Millennium ident. Don't ask. */ 141 141 ChipID = ReadDOC(window, ChipID); 142 - 142 + 143 143 switch (ChipID) { 144 144 case DOC_ChipID_Doc2k: 145 145 /* Check the TOGGLE bit in the ECC register */ ··· 149 149 if (tmp != tmpb && tmp == tmpc) 150 150 return ChipID; 151 151 break; 152 - 152 + 153 153 case DOC_ChipID_DocMil: 154 154 /* Check for the new 2000 with Millennium ASIC */ 155 155 ReadDOC(window, ChipID); ··· 164 164 if (tmp != tmpb && tmp == tmpc) 165 165 return ChipID; 166 166 break; 167 - 167 + 168 168 case DOC_ChipID_DocMilPlus16: 169 169 case DOC_ChipID_DocMilPlus32: 170 170 case 0: ··· 179 179 DOC_MODE_BDECT; 180 180 WriteDOC(tmp, window, Mplus_DOCControl); 181 181 WriteDOC(~tmp, window, Mplus_CtrlConfirm); 182 - 182 + 183 183 mdelay(1); 184 184 /* Enable the DiskOnChip ASIC */ 185 185 tmp = DOC_MODE_NORMAL | DOC_MODE_MDWREN | DOC_MODE_RST_LAT | ··· 187 187 WriteDOC(tmp, window, Mplus_DOCControl); 188 188 WriteDOC(~tmp, window, Mplus_CtrlConfirm); 189 189 mdelay(1); 190 - #endif /* !DOC_PASSIVE_PROBE */ 190 + #endif /* !DOC_PASSIVE_PROBE */ 191 191 192 192 ChipID = ReadDOC(window, ChipID); 193 193 ··· 227 227 WriteDOC(tmp2, window, DOCControl); 228 228 #endif 229 229 return 0; 230 - } 230 + } 231 231 232 232 static int docfound; 233 233 ··· 244 244 void (*initroutine)(struct mtd_info *) = NULL; 245 245 246 246 docptr = ioremap(physadr, DOC_IOREMAP_LEN); 247 - 247 + 248 248 if (!docptr) 249 249 return; 250 - 250 + 251 251 if ((ChipID = doccheck(docptr, physadr))) { 252 252 if (ChipID == DOC_ChipID_Doc2kTSOP) { 253 253 /* Remove this at your own peril. The hardware driver works but nothing prevents you from erasing bad blocks */ ··· 263 263 iounmap(docptr); 264 264 return; 265 265 } 266 - 266 + 267 267 this = (struct DiskOnChip *)(&mtd[1]); 268 - 268 + 269 269 memset((char *)mtd,0, sizeof(struct mtd_info)); 270 270 memset((char *)this, 0, sizeof(struct DiskOnChip)); 271 271 ··· 281 281 im_funcname = "DoC2k_init"; 282 282 im_modname = "doc2000"; 283 283 break; 284 - 284 + 285 285 case DOC_ChipID_Doc2k: 286 286 name="2000"; 287 287 im_funcname = "DoC2k_init"; 288 288 im_modname = "doc2000"; 289 289 break; 290 - 290 + 291 291 case DOC_ChipID_DocMil: 292 292 name="Millennium"; 293 293 #ifdef DOC_SINGLE_DRIVER ··· 331 331 static int __init init_doc(void) 332 332 { 333 333 int i; 334 - 334 + 335 335 if (doc_config_location) { 336 336 printk(KERN_INFO "Using configured DiskOnChip probe address 0x%lx\n", doc_config_location); 337 337 DoC_Probe(doc_config_location);
+4 -4
drivers/mtd/devices/lart.c
··· 2 2 /* 3 3 * MTD driver for the 28F160F3 Flash Memory (non-CFI) on LART. 4 4 * 5 - * $Id: lart.c,v 1.7 2004/08/09 13:19:44 dwmw2 Exp $ 5 + * $Id: lart.c,v 1.9 2005/11/07 11:14:25 gleixner Exp $ 6 6 * 7 7 * Author: Abraham vd Merwe <abraham@2d3d.co.za> 8 8 * ··· 122 122 123 123 /* 124 124 * The data line mapping on LART is as follows: 125 - * 125 + * 126 126 * U2 CPU | U3 CPU 127 127 * ------------------- 128 128 * 0 20 | 0 12 ··· 181 181 (((x) & 0x00004000) >> 13) \ 182 182 ) 183 183 184 - /* 184 + /* 185 185 * The address line mapping on LART is as follows: 186 186 * 187 187 * U3 CPU | U2 CPU ··· 204 204 * 12 15 | 12 15 205 205 * 13 14 | 13 14 206 206 * 14 16 | 14 16 207 - * 207 + * 208 208 * MAIN BLOCK BOUNDARY 209 209 * 210 210 * 15 17 | 15 18
+7 -7
drivers/mtd/devices/phram.c
··· 1 1 /** 2 - * $Id: phram.c,v 1.14 2005/03/07 21:43:38 joern Exp $ 2 + * $Id: phram.c,v 1.16 2005/11/07 11:14:25 gleixner Exp $ 3 3 * 4 4 * Copyright (c) ???? Jochen Sch�uble <psionic@psionic.de> 5 5 * Copyright (c) 2003-2004 J�rn Engel <joern@wh.fh-wedel.de> ··· 41 41 42 42 if (instr->addr + instr->len > mtd->size) 43 43 return -EINVAL; 44 - 44 + 45 45 memset(start + instr->addr, 0xff, instr->len); 46 46 47 - /* This'll catch a few races. Free the thing before returning :) 47 + /* This'll catch a few races. Free the thing before returning :) 48 48 * I don't feel at all ashamed. This kind of thing is possible anyway 49 49 * with flash, but unlikely. 50 50 */ ··· 63 63 64 64 if (from + len > mtd->size) 65 65 return -EINVAL; 66 - 66 + 67 67 *mtdbuf = start + from; 68 68 *retlen = len; 69 69 return 0; ··· 84 84 85 85 if (len > mtd->size - from) 86 86 len = mtd->size - from; 87 - 87 + 88 88 memcpy(buf, start + from, len); 89 89 90 90 *retlen = len; ··· 101 101 102 102 if (len > mtd->size - to) 103 103 len = mtd->size - to; 104 - 104 + 105 105 memcpy(start + to, buf, len); 106 106 107 107 *retlen = len; ··· 159 159 } 160 160 161 161 list_add_tail(&new->list, &phram_list); 162 - return 0; 162 + return 0; 163 163 164 164 out2: 165 165 iounmap(new->mtd.priv);
+12 -12
drivers/mtd/devices/pmc551.c
··· 1 1 /* 2 - * $Id: pmc551.c,v 1.30 2005/01/05 18:05:13 dwmw2 Exp $ 2 + * $Id: pmc551.c,v 1.32 2005/11/07 11:14:25 gleixner Exp $ 3 3 * 4 4 * PMC551 PCI Mezzanine Ram Device 5 5 * ··· 27 27 * it as high speed swap or for a high speed disk device of some 28 28 * sort. Which becomes very useful on diskless systems in the 29 29 * embedded market I might add. 30 - * 30 + * 31 31 * Notes: 32 32 * Due to what I assume is more buggy SROM, the 64M PMC551 I 33 33 * have available claims that all 4 of it's DRAM banks have 64M ··· 63 63 * Minyard set up the card to utilize a 1M sliding apature. 64 64 * 65 65 * Corey Minyard <minyard@nortelnetworks.com> 66 - * * Modified driver to utilize a sliding aperture instead of 66 + * * Modified driver to utilize a sliding aperture instead of 67 67 * mapping all memory into kernel space which turned out to 68 68 * be very wasteful. 69 - * * Located a bug in the SROM's initialization sequence that 69 + * * Located a bug in the SROM's initialization sequence that 70 70 * made the memory unusable, added a fix to code to touch up 71 71 * the DRAM some. 72 72 * ··· 390 390 bcmd |= (0x40|0x20); 391 391 pci_write_config_byte(dev, PMC551_SYS_CTRL_REG, bcmd); 392 392 393 - /* 393 + /* 394 394 * Take care and turn off the memory on the device while we 395 395 * tweak the configurations 396 396 */ ··· 408 408 * Grab old BAR0 config so that we can figure out memory size 409 409 * This is another bit of kludge going on. The reason for the 410 410 * redundancy is I am hoping to retain the original configuration 411 - * previously assigned to the card by the BIOS or some previous 411 + * previously assigned to the card by the BIOS or some previous 412 412 * fixup routine in the kernel. So we read the old config into cfg, 413 413 * then write all 1's to the memory space, read back the result into 414 414 * "size", and then write back all the old config. ··· 480 480 } while ( (PCI_COMMAND_IO) & cmd ); 481 481 482 482 /* 483 - * Turn on auto refresh 483 + * Turn on auto refresh 484 484 * The loop is taken directly from Ramix's example code. I assume that 485 485 * this must be held high for some duration of time, but I can find no 486 486 * documentation refrencing the reasons why. ··· 615 615 pci_read_config_byte(dev, PMC551_SYS_CTRL_REG, &bcmd ); 616 616 printk( KERN_DEBUG "pmc551: EEPROM is under %s control\n" 617 617 "pmc551: System Control Register is %slocked to PCI access\n" 618 - "pmc551: System Control Register is %slocked to EEPROM access\n", 618 + "pmc551: System Control Register is %slocked to EEPROM access\n", 619 619 (bcmd&0x1)?"software":"hardware", 620 620 (bcmd&0x20)?"":"un", (bcmd&0x40)?"":"un"); 621 621 #endif ··· 744 744 priv->start = ioremap(((PCI_Device->resource[0].start) 745 745 & PCI_BASE_ADDRESS_MEM_MASK), 746 746 priv->asize); 747 - 747 + 748 748 if (!priv->start) { 749 749 printk(KERN_NOTICE "pmc551: Unable to map IO space\n"); 750 750 kfree(mtd->priv); ··· 765 765 priv->curr_map0 ); 766 766 767 767 #ifdef CONFIG_MTD_PMC551_DEBUG 768 - printk( KERN_DEBUG "pmc551: aperture set to %d\n", 768 + printk( KERN_DEBUG "pmc551: aperture set to %d\n", 769 769 (priv->base_map0 & 0xF0)>>4 ); 770 770 #endif 771 771 ··· 823 823 while((mtd=pmc551list)) { 824 824 priv = mtd->priv; 825 825 pmc551list = priv->nextpmc551; 826 - 826 + 827 827 if(priv->start) { 828 828 printk (KERN_DEBUG "pmc551: unmapping %dM starting at 0x%p\n", 829 829 priv->asize>>20, priv->start); 830 830 iounmap (priv->start); 831 831 } 832 - 832 + 833 833 kfree (mtd->priv); 834 834 del_mtd_device (mtd); 835 835 kfree (mtd);
+15 -15
drivers/mtd/devices/slram.c
··· 1 1 /*====================================================================== 2 2 3 - $Id: slram.c,v 1.34 2005/01/06 21:16:42 jwboyer Exp $ 3 + $Id: slram.c,v 1.36 2005/11/07 11:14:25 gleixner Exp $ 4 4 5 5 This driver provides a method to access memory not used by the kernel 6 6 itself (i.e. if the kernel commandline mem=xxx is used). To actually ··· 18 18 <start>: start of the memory region, decimal or hex (0xabcdef) 19 19 <end/offset>: end of the memory region. It's possible to use +0x1234 20 20 to specify the offset instead of the absolute address 21 - 21 + 22 22 NOTE: 23 23 With slram it's only possible to map a contigous memory region. Therfore 24 24 if there's a device mapped somewhere in the region specified slram will 25 25 fail to load (see kernel log if modprobe fails). 26 26 27 27 - 28 - 28 + 29 29 Jochen Schaeuble <psionic@psionic.de> 30 30 31 31 ======================================================================*/ ··· 89 89 if (instr->addr + instr->len > mtd->size) { 90 90 return(-EINVAL); 91 91 } 92 - 92 + 93 93 memset(priv->start + instr->addr, 0xff, instr->len); 94 94 95 - /* This'll catch a few races. Free the thing before returning :) 95 + /* This'll catch a few races. Free the thing before returning :) 96 96 * I don't feel at all ashamed. This kind of thing is possible anyway 97 97 * with flash, but unlikely. 98 98 */ ··· 170 170 } 171 171 (*curmtd)->mtdinfo = kmalloc(sizeof(struct mtd_info), GFP_KERNEL); 172 172 (*curmtd)->next = NULL; 173 - 173 + 174 174 if ((*curmtd)->mtdinfo) { 175 175 memset((char *)(*curmtd)->mtdinfo, 0, sizeof(struct mtd_info)); 176 176 (*curmtd)->mtdinfo->priv = 177 177 kmalloc(sizeof(slram_priv_t), GFP_KERNEL); 178 - 178 + 179 179 if (!(*curmtd)->mtdinfo->priv) { 180 180 kfree((*curmtd)->mtdinfo); 181 181 (*curmtd)->mtdinfo = NULL; ··· 188 188 E("slram: Cannot allocate new MTD device.\n"); 189 189 return(-ENOMEM); 190 190 } 191 - 191 + 192 192 if (!(((slram_priv_t *)(*curmtd)->mtdinfo->priv)->start = 193 193 ioremap(start, length))) { 194 194 E("slram: ioremap failed\n"); ··· 223 223 T("slram: Mapped from 0x%p to 0x%p\n", 224 224 ((slram_priv_t *)(*curmtd)->mtdinfo->priv)->start, 225 225 ((slram_priv_t *)(*curmtd)->mtdinfo->priv)->end); 226 - return(0); 226 + return(0); 227 227 } 228 228 229 229 static void unregister_devices(void) ··· 256 256 char *buffer; 257 257 unsigned long devstart; 258 258 unsigned long devlength; 259 - 259 + 260 260 if ((!devname) || (!szstart) || (!szlength)) { 261 261 unregister_devices(); 262 262 return(-EINVAL); ··· 264 264 265 265 devstart = simple_strtoul(szstart, &buffer, 0); 266 266 devstart = handle_unit(devstart, buffer); 267 - 267 + 268 268 if (*(szlength) != '+') { 269 269 devlength = simple_strtoul(szlength, &buffer, 0); 270 270 devlength = handle_unit(devlength, buffer) - devstart; ··· 278 278 E("slram: Illegal start / length parameter.\n"); 279 279 return(-EINVAL); 280 280 } 281 - 281 + 282 282 if ((devstart = register_device(devname, devstart, devlength))){ 283 283 unregister_devices(); 284 284 return((int)devstart); ··· 335 335 } 336 336 #else 337 337 int count; 338 - 338 + 339 339 for (count = 0; (map[count]) && (count < SLRAM_MAX_DEVICES_PARAMS); 340 340 count++) { 341 341 } ··· 350 350 if (parse_cmdline(devname, map[i * 3 + 1], map[i * 3 + 2])!=0) { 351 351 return(-EINVAL); 352 352 } 353 - 353 + 354 354 } 355 355 #endif /* !MODULE */ 356 - 356 + 357 357 return(0); 358 358 } 359 359