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

mtd: replace DEBUG() with pr_debug()

Start moving away from the MTD_DEBUG_LEVEL messages. The dynamic
debugging feature is a generic kernel feature that provides more
flexibility.

(See Documentation/dynamic-debug-howto.txt)

Also fix some punctuation, indentation, and capitalization that went
along with the affected lines.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>

authored by

Brian Norris and committed by
Artem Bityutskiy
289c0522 d0370219

+216 -249
+12 -15
drivers/mtd/chips/cfi_cmdset_0002.c
··· 145 145 if (((major << 8) | minor) < 0x3131) { 146 146 /* CFI version 1.0 => don't trust bootloc */ 147 147 148 - DEBUG(MTD_DEBUG_LEVEL1, 149 - "%s: JEDEC Vendor ID is 0x%02X Device ID is 0x%02X\n", 148 + pr_debug("%s: JEDEC Vendor ID is 0x%02X Device ID is 0x%02X\n", 150 149 map->name, cfi->mfr, cfi->id); 151 150 152 151 /* AFAICS all 29LV400 with a bottom boot block have a device ID ··· 165 166 * the 8-bit device ID. 166 167 */ 167 168 (cfi->mfr == CFI_MFR_MACRONIX)) { 168 - DEBUG(MTD_DEBUG_LEVEL1, 169 - "%s: Macronix MX29LV400C with bottom boot block" 169 + pr_debug("%s: Macronix MX29LV400C with bottom boot block" 170 170 " detected\n", map->name); 171 171 extp->TopBottom = 2; /* bottom boot */ 172 172 } else ··· 176 178 extp->TopBottom = 2; /* bottom boot */ 177 179 } 178 180 179 - DEBUG(MTD_DEBUG_LEVEL1, 180 - "%s: AMD CFI PRI V%c.%c has no boot block field;" 181 + pr_debug("%s: AMD CFI PRI V%c.%c has no boot block field;" 181 182 " deduced %s from Device ID\n", map->name, major, minor, 182 183 extp->TopBottom == 2 ? "bottom" : "top"); 183 184 } ··· 188 191 struct map_info *map = mtd->priv; 189 192 struct cfi_private *cfi = map->fldrv_priv; 190 193 if (cfi->cfiq->BufWriteTimeoutTyp) { 191 - DEBUG(MTD_DEBUG_LEVEL1, "Using buffer write method\n" ); 194 + pr_debug("Using buffer write method\n" ); 192 195 mtd->write = cfi_amdstd_write_buffers; 193 196 } 194 197 } ··· 440 443 mtd->writesize = 1; 441 444 mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; 442 445 443 - DEBUG(MTD_DEBUG_LEVEL3, "MTD %s(): write buffer size %d\n", 446 + pr_debug("MTD %s(): write buffer size %d\n", 444 447 __func__, mtd->writebufsize); 445 448 446 449 mtd->reboot_notifier.notifier_call = cfi_amdstd_reboot; ··· 1160 1163 return ret; 1161 1164 } 1162 1165 1163 - DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): WRITE 0x%.8lx(0x%.8lx)\n", 1166 + pr_debug("MTD %s(): WRITE 0x%.8lx(0x%.8lx)\n", 1164 1167 __func__, adr, datum.x[0] ); 1165 1168 1166 1169 /* ··· 1171 1174 */ 1172 1175 oldd = map_read(map, adr); 1173 1176 if (map_word_equal(map, oldd, datum)) { 1174 - DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): NOP\n", 1177 + pr_debug("MTD %s(): NOP\n", 1175 1178 __func__); 1176 1179 goto op_done; 1177 1180 } ··· 1397 1400 1398 1401 datum = map_word_load(map, buf); 1399 1402 1400 - DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): WRITE 0x%.8lx(0x%.8lx)\n", 1403 + pr_debug("MTD %s(): WRITE 0x%.8lx(0x%.8lx)\n", 1401 1404 __func__, adr, datum.x[0] ); 1402 1405 1403 1406 XIP_INVAL_CACHED_RANGE(map, adr, len); ··· 1584 1587 return ret; 1585 1588 } 1586 1589 1587 - DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): ERASE 0x%.8lx\n", 1590 + pr_debug("MTD %s(): ERASE 0x%.8lx\n", 1588 1591 __func__, chip->start ); 1589 1592 1590 1593 XIP_INVAL_CACHED_RANGE(map, adr, map->size); ··· 1672 1675 return ret; 1673 1676 } 1674 1677 1675 - DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): ERASE 0x%.8lx\n", 1678 + pr_debug("MTD %s(): ERASE 0x%.8lx\n", 1676 1679 __func__, adr ); 1677 1680 1678 1681 XIP_INVAL_CACHED_RANGE(map, adr, len); ··· 1798 1801 goto out_unlock; 1799 1802 chip->state = FL_LOCKING; 1800 1803 1801 - DEBUG(MTD_DEBUG_LEVEL3, "MTD %s(): LOCK 0x%08lx len %d\n", 1804 + pr_debug("MTD %s(): LOCK 0x%08lx len %d\n", 1802 1805 __func__, adr, len); 1803 1806 1804 1807 cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, ··· 1834 1837 goto out_unlock; 1835 1838 chip->state = FL_UNLOCKING; 1836 1839 1837 - DEBUG(MTD_DEBUG_LEVEL3, "MTD %s(): LOCK 0x%08lx len %d\n", 1840 + pr_debug("MTD %s(): LOCK 0x%08lx len %d\n", 1838 1841 __func__, adr, len); 1839 1842 1840 1843 cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi,
+1 -2
drivers/mtd/chips/fwh_lock.h
··· 34 34 35 35 /* Refuse the operation if the we cannot look behind the chip */ 36 36 if (chip->start < 0x400000) { 37 - DEBUG( MTD_DEBUG_LEVEL3, 38 - "MTD %s(): chip->start: %lx wanted >= 0x400000\n", 37 + pr_debug( "MTD %s(): chip->start: %lx wanted >= 0x400000\n", 39 38 __func__, chip->start ); 40 39 return -EIO; 41 40 }
+12 -20
drivers/mtd/chips/jedec_probe.c
··· 1917 1917 * as they will ignore the writes and don't care what address 1918 1918 * the F0 is written to */ 1919 1919 if (cfi->addr_unlock1) { 1920 - DEBUG( MTD_DEBUG_LEVEL3, 1921 - "reset unlock called %x %x \n", 1920 + pr_debug( "reset unlock called %x %x \n", 1922 1921 cfi->addr_unlock1,cfi->addr_unlock2); 1923 1922 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); 1924 1923 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL); ··· 1940 1941 uint8_t uaddr; 1941 1942 1942 1943 if (!(jedec_table[index].devtypes & cfi->device_type)) { 1943 - DEBUG(MTD_DEBUG_LEVEL1, "Rejecting potential %s with incompatible %d-bit device type\n", 1944 + pr_debug("Rejecting potential %s with incompatible %d-bit device type\n", 1944 1945 jedec_table[index].name, 4 * (1<<cfi->device_type)); 1945 1946 return 0; 1946 1947 } ··· 2020 2021 * there aren't. 2021 2022 */ 2022 2023 if (finfo->dev_id > 0xff) { 2023 - DEBUG( MTD_DEBUG_LEVEL3, "%s(): ID is not 8bit\n", 2024 + pr_debug("%s(): ID is not 8bit\n", 2024 2025 __func__); 2025 2026 goto match_done; 2026 2027 } ··· 2044 2045 } 2045 2046 2046 2047 /* the part size must fit in the memory window */ 2047 - DEBUG( MTD_DEBUG_LEVEL3, 2048 - "MTD %s(): Check fit 0x%.8x + 0x%.8x = 0x%.8x\n", 2048 + pr_debug("MTD %s(): Check fit 0x%.8x + 0x%.8x = 0x%.8x\n", 2049 2049 __func__, base, 1 << finfo->dev_size, base + (1 << finfo->dev_size) ); 2050 2050 if ( base + cfi_interleave(cfi) * ( 1 << finfo->dev_size ) > map->size ) { 2051 - DEBUG( MTD_DEBUG_LEVEL3, 2052 - "MTD %s(): 0x%.4x 0x%.4x %dKiB doesn't fit\n", 2051 + pr_debug("MTD %s(): 0x%.4x 0x%.4x %dKiB doesn't fit\n", 2053 2052 __func__, finfo->mfr_id, finfo->dev_id, 2054 2053 1 << finfo->dev_size ); 2055 2054 goto match_done; ··· 2058 2061 2059 2062 uaddr = finfo->uaddr; 2060 2063 2061 - DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): check unlock addrs 0x%.4x 0x%.4x\n", 2064 + pr_debug("MTD %s(): check unlock addrs 0x%.4x 0x%.4x\n", 2062 2065 __func__, cfi->addr_unlock1, cfi->addr_unlock2 ); 2063 2066 if ( MTD_UADDR_UNNECESSARY != uaddr && MTD_UADDR_DONT_CARE != uaddr 2064 2067 && ( unlock_addrs[uaddr].addr1 / cfi->device_type != cfi->addr_unlock1 || 2065 2068 unlock_addrs[uaddr].addr2 / cfi->device_type != cfi->addr_unlock2 ) ) { 2066 - DEBUG( MTD_DEBUG_LEVEL3, 2067 - "MTD %s(): 0x%.4x 0x%.4x did not match\n", 2069 + pr_debug("MTD %s(): 0x%.4x 0x%.4x did not match\n", 2068 2070 __func__, 2069 2071 unlock_addrs[uaddr].addr1, 2070 2072 unlock_addrs[uaddr].addr2); ··· 2079 2083 * FIXME - write a driver that takes all of the chip info as 2080 2084 * module parameters, doesn't probe but forces a load. 2081 2085 */ 2082 - DEBUG( MTD_DEBUG_LEVEL3, 2083 - "MTD %s(): check ID's disappear when not in ID mode\n", 2086 + pr_debug("MTD %s(): check ID's disappear when not in ID mode\n", 2084 2087 __func__ ); 2085 2088 jedec_reset( base, map, cfi ); 2086 2089 mfr = jedec_read_mfr( map, base, cfi ); 2087 2090 id = jedec_read_id( map, base, cfi ); 2088 2091 if ( mfr == cfi->mfr && id == cfi->id ) { 2089 - DEBUG( MTD_DEBUG_LEVEL3, 2090 - "MTD %s(): ID 0x%.2x:0x%.2x did not change after reset:\n" 2092 + pr_debug("MTD %s(): ID 0x%.2x:0x%.2x did not change after reset:\n" 2091 2093 "You might need to manually specify JEDEC parameters.\n", 2092 2094 __func__, cfi->mfr, cfi->id ); 2093 2095 goto match_done; ··· 2098 2104 * Put the device back in ID mode - only need to do this if we 2099 2105 * were truly frobbing a real device. 2100 2106 */ 2101 - DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): return to ID mode\n", __func__ ); 2107 + pr_debug("MTD %s(): return to ID mode\n", __func__ ); 2102 2108 if (cfi->addr_unlock1) { 2103 2109 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); 2104 2110 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL); ··· 2161 2167 2162 2168 cfi->mfr = jedec_read_mfr(map, base, cfi); 2163 2169 cfi->id = jedec_read_id(map, base, cfi); 2164 - DEBUG(MTD_DEBUG_LEVEL3, 2165 - "Search for id:(%02x %02x) interleave(%d) type(%d)\n", 2170 + pr_debug("Search for id:(%02x %02x) interleave(%d) type(%d)\n", 2166 2171 cfi->mfr, cfi->id, cfi_interleave(cfi), cfi->device_type); 2167 2172 for (i = 0; i < ARRAY_SIZE(jedec_table); i++) { 2168 2173 if ( jedec_match( base, map, cfi, &jedec_table[i] ) ) { 2169 - DEBUG( MTD_DEBUG_LEVEL3, 2170 - "MTD %s(): matched device 0x%x,0x%x unlock_addrs: 0x%.4x 0x%.4x\n", 2174 + pr_debug("MTD %s(): matched device 0x%x,0x%x unlock_addrs: 0x%.4x 0x%.4x\n", 2171 2175 __func__, cfi->mfr, cfi->id, 2172 2176 cfi->addr_unlock1, cfi->addr_unlock2 ); 2173 2177 if (!cfi_jedec_setup(map, cfi, i))
+4 -7
drivers/mtd/devices/doc2000.c
··· 82 82 void __iomem *docptr = doc->virtadr; 83 83 unsigned long timeo = jiffies + (HZ * 10); 84 84 85 - DEBUG(MTD_DEBUG_LEVEL3, 86 - "_DoC_WaitReady called for out-of-line wait\n"); 85 + pr_debug("_DoC_WaitReady called for out-of-line wait\n"); 87 86 88 87 /* Out-of-line routine to wait for chip response */ 89 88 while (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B)) { ··· 91 92 DoC_Delay(doc, 2); 92 93 93 94 if (time_after(jiffies, timeo)) { 94 - DEBUG(MTD_DEBUG_LEVEL2, "_DoC_WaitReady timed out.\n"); 95 + pr_debug("_DoC_WaitReady timed out.\n"); 95 96 return -EIO; 96 97 } 97 98 udelay(1); ··· 322 323 323 324 /* Reset the chip */ 324 325 if (DoC_Command(doc, NAND_CMD_RESET, CDSN_CTRL_WP)) { 325 - DEBUG(MTD_DEBUG_LEVEL2, 326 - "DoC_Command (reset) for %d,%d returned true\n", 326 + pr_debug("DoC_Command (reset) for %d,%d returned true\n", 327 327 floor, chip); 328 328 return 0; 329 329 } ··· 330 332 331 333 /* Read the NAND chip ID: 1. Send ReadID command */ 332 334 if (DoC_Command(doc, NAND_CMD_READID, CDSN_CTRL_WP)) { 333 - DEBUG(MTD_DEBUG_LEVEL2, 334 - "DoC_Command (ReadID) for %d,%d returned true\n", 335 + pr_debug("DoC_Command (ReadID) for %d,%d returned true\n", 335 336 floor, chip); 336 337 return 0; 337 338 }
+2 -3
drivers/mtd/devices/doc2001.c
··· 55 55 { 56 56 unsigned short c = 0xffff; 57 57 58 - DEBUG(MTD_DEBUG_LEVEL3, 59 - "_DoC_WaitReady called for out-of-line wait\n"); 58 + pr_debug("_DoC_WaitReady called for out-of-line wait\n"); 60 59 61 60 /* Out-of-line routine to wait for chip response */ 62 61 while (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B) && --c) 63 62 ; 64 63 65 64 if (c == 0) 66 - DEBUG(MTD_DEBUG_LEVEL2, "_DoC_WaitReady timed out.\n"); 65 + pr_debug("_DoC_WaitReady timed out.\n"); 67 66 68 67 return (c == 0); 69 68 }
+2 -3
drivers/mtd/devices/doc2001plus.c
··· 61 61 { 62 62 unsigned int c = 0xffff; 63 63 64 - DEBUG(MTD_DEBUG_LEVEL3, 65 - "_DoC_WaitReady called for out-of-line wait\n"); 64 + pr_debug("_DoC_WaitReady called for out-of-line wait\n"); 66 65 67 66 /* Out-of-line routine to wait for chip response */ 68 67 while (((ReadDOC(docptr, Mplus_FlashControl) & CDSN_CTRL_FR_B_MASK) != CDSN_CTRL_FR_B_MASK) && --c) 69 68 ; 70 69 71 70 if (c == 0) 72 - DEBUG(MTD_DEBUG_LEVEL2, "_DoC_WaitReady timed out.\n"); 71 + pr_debug("_DoC_WaitReady timed out.\n"); 73 72 74 73 return (c == 0); 75 74 }
+9 -11
drivers/mtd/devices/m25p80.c
··· 208 208 */ 209 209 static int erase_chip(struct m25p *flash) 210 210 { 211 - DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %lldKiB\n", 211 + pr_debug("%s: %s %lldKiB\n", 212 212 dev_name(&flash->spi->dev), __func__, 213 213 (long long)(flash->mtd.size >> 10)); 214 214 ··· 249 249 */ 250 250 static int erase_sector(struct m25p *flash, u32 offset) 251 251 { 252 - DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB at 0x%08x\n", 252 + pr_debug("%s: %s %dKiB at 0x%08x\n", 253 253 dev_name(&flash->spi->dev), __func__, 254 254 flash->mtd.erasesize / 1024, offset); 255 255 ··· 285 285 u32 addr,len; 286 286 uint32_t rem; 287 287 288 - DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%llx, len %lld\n", 288 + pr_debug("%s: %s %s 0x%llx, len %lld\n", 289 289 dev_name(&flash->spi->dev), __func__, "at", 290 290 (long long)instr->addr, (long long)instr->len); 291 291 ··· 347 347 struct spi_transfer t[2]; 348 348 struct spi_message m; 349 349 350 - DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", 350 + pr_debug("%s: %s %s 0x%08x, len %zd\n", 351 351 dev_name(&flash->spi->dev), __func__, "from", 352 352 (u32)from, len); 353 353 ··· 416 416 struct spi_transfer t[2]; 417 417 struct spi_message m; 418 418 419 - DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", 419 + pr_debug("%s: %s %s 0x%08x, len %zd\n", 420 420 dev_name(&flash->spi->dev), __func__, "to", 421 421 (u32)to, len); 422 422 ··· 509 509 size_t actual; 510 510 int cmd_sz, ret; 511 511 512 - DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n", 512 + pr_debug("%s: %s %s 0x%08x, len %zd\n", 513 513 dev_name(&flash->spi->dev), __func__, "to", 514 514 (u32)to, len); 515 515 ··· 787 787 */ 788 788 tmp = spi_write_then_read(spi, &code, 1, id, 5); 789 789 if (tmp < 0) { 790 - DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", 790 + pr_debug("%s: error %d reading JEDEC ID\n", 791 791 dev_name(&spi->dev), tmp); 792 792 return ERR_PTR(tmp); 793 793 } ··· 944 944 dev_info(&spi->dev, "%s (%lld Kbytes)\n", id->name, 945 945 (long long)flash->mtd.size >> 10); 946 946 947 - DEBUG(MTD_DEBUG_LEVEL2, 948 - "mtd .name = %s, .size = 0x%llx (%lldMiB) " 947 + pr_debug("mtd .name = %s, .size = 0x%llx (%lldMiB) " 949 948 ".erasesize = 0x%.8x (%uKiB) .numeraseregions = %d\n", 950 949 flash->mtd.name, 951 950 (long long)flash->mtd.size, (long long)(flash->mtd.size >> 20), ··· 953 954 954 955 if (flash->mtd.numeraseregions) 955 956 for (i = 0; i < flash->mtd.numeraseregions; i++) 956 - DEBUG(MTD_DEBUG_LEVEL2, 957 - "mtd.eraseregions[%d] = { .offset = 0x%llx, " 957 + pr_debug("mtd.eraseregions[%d] = { .offset = 0x%llx, " 958 958 ".erasesize = 0x%.8x (%uKiB), " 959 959 ".numblocks = %d }\n", 960 960 i, (long long)flash->mtd.eraseregions[i].offset,
+21 -22
drivers/mtd/devices/mtd_dataflash.c
··· 133 133 for (;;) { 134 134 status = dataflash_status(spi); 135 135 if (status < 0) { 136 - DEBUG(MTD_DEBUG_LEVEL1, "%s: status %d?\n", 136 + pr_debug("%s: status %d?\n", 137 137 dev_name(&spi->dev), status); 138 138 status = 0; 139 139 } ··· 160 160 uint8_t *command; 161 161 uint32_t rem; 162 162 163 - DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%llx len 0x%llx\n", 163 + pr_debug("%s: erase addr=0x%llx len 0x%llx\n", 164 164 dev_name(&spi->dev), (long long)instr->addr, 165 165 (long long)instr->len); 166 166 ··· 198 198 command[2] = (uint8_t)(pageaddr >> 8); 199 199 command[3] = 0; 200 200 201 - DEBUG(MTD_DEBUG_LEVEL3, "ERASE %s: (%x) %x %x %x [%i]\n", 201 + pr_debug("ERASE %s: (%x) %x %x %x [%i]\n", 202 202 do_block ? "block" : "page", 203 203 command[0], command[1], command[2], command[3], 204 204 pageaddr); ··· 249 249 uint8_t *command; 250 250 int status; 251 251 252 - DEBUG(MTD_DEBUG_LEVEL2, "%s: read 0x%x..0x%x\n", 252 + pr_debug("%s: read 0x%x..0x%x\n", 253 253 dev_name(&priv->spi->dev), (unsigned)from, (unsigned)(from + len)); 254 254 255 255 *retlen = 0; ··· 266 266 267 267 command = priv->command; 268 268 269 - DEBUG(MTD_DEBUG_LEVEL3, "READ: (%x) %x %x %x\n", 269 + pr_debug("READ: (%x) %x %x %x\n", 270 270 command[0], command[1], command[2], command[3]); 271 271 272 272 spi_message_init(&msg); ··· 298 298 *retlen = msg.actual_length - 8; 299 299 status = 0; 300 300 } else 301 - DEBUG(MTD_DEBUG_LEVEL1, "%s: read %x..%x --> %d\n", 301 + pr_debug("%s: read %x..%x --> %d\n", 302 302 dev_name(&priv->spi->dev), 303 303 (unsigned)from, (unsigned)(from + len), 304 304 status); ··· 325 325 int status = -EINVAL; 326 326 uint8_t *command; 327 327 328 - DEBUG(MTD_DEBUG_LEVEL2, "%s: write 0x%x..0x%x\n", 328 + pr_debug("%s: write 0x%x..0x%x\n", 329 329 dev_name(&spi->dev), (unsigned)to, (unsigned)(to + len)); 330 330 331 331 *retlen = 0; ··· 351 351 352 352 mutex_lock(&priv->lock); 353 353 while (remaining > 0) { 354 - DEBUG(MTD_DEBUG_LEVEL3, "write @ %i:%i len=%i\n", 354 + pr_debug("write @ %i:%i len=%i\n", 355 355 pageaddr, offset, writelen); 356 356 357 357 /* REVISIT: ··· 379 379 command[2] = (addr & 0x0000FF00) >> 8; 380 380 command[3] = 0; 381 381 382 - DEBUG(MTD_DEBUG_LEVEL3, "TRANSFER: (%x) %x %x %x\n", 382 + pr_debug("TRANSFER: (%x) %x %x %x\n", 383 383 command[0], command[1], command[2], command[3]); 384 384 385 385 status = spi_sync(spi, &msg); 386 386 if (status < 0) 387 - DEBUG(MTD_DEBUG_LEVEL1, "%s: xfer %u -> %d \n", 387 + pr_debug("%s: xfer %u -> %d \n", 388 388 dev_name(&spi->dev), addr, status); 389 389 390 390 (void) dataflash_waitready(priv->spi); ··· 397 397 command[2] = (addr & 0x0000FF00) >> 8; 398 398 command[3] = (addr & 0x000000FF); 399 399 400 - DEBUG(MTD_DEBUG_LEVEL3, "PROGRAM: (%x) %x %x %x\n", 400 + pr_debug("PROGRAM: (%x) %x %x %x\n", 401 401 command[0], command[1], command[2], command[3]); 402 402 403 403 x[1].tx_buf = writebuf; ··· 406 406 status = spi_sync(spi, &msg); 407 407 spi_transfer_del(x + 1); 408 408 if (status < 0) 409 - DEBUG(MTD_DEBUG_LEVEL1, "%s: pgm %u/%u -> %d \n", 409 + pr_debug("%s: pgm %u/%u -> %d \n", 410 410 dev_name(&spi->dev), addr, writelen, status); 411 411 412 412 (void) dataflash_waitready(priv->spi); ··· 421 421 command[2] = (addr & 0x0000FF00) >> 8; 422 422 command[3] = 0; 423 423 424 - DEBUG(MTD_DEBUG_LEVEL3, "COMPARE: (%x) %x %x %x\n", 424 + pr_debug("COMPARE: (%x) %x %x %x\n", 425 425 command[0], command[1], command[2], command[3]); 426 426 427 427 status = spi_sync(spi, &msg); 428 428 if (status < 0) 429 - DEBUG(MTD_DEBUG_LEVEL1, "%s: compare %u -> %d \n", 429 + pr_debug("%s: compare %u -> %d \n", 430 430 dev_name(&spi->dev), addr, status); 431 431 432 432 status = dataflash_waitready(priv->spi); ··· 780 780 */ 781 781 tmp = spi_write_then_read(spi, &code, 1, id, 3); 782 782 if (tmp < 0) { 783 - DEBUG(MTD_DEBUG_LEVEL0, "%s: error %d reading JEDEC ID\n", 783 + pr_debug("%s: error %d reading JEDEC ID\n", 784 784 dev_name(&spi->dev), tmp); 785 785 return ERR_PTR(tmp); 786 786 } ··· 797 797 tmp < ARRAY_SIZE(dataflash_data); 798 798 tmp++, info++) { 799 799 if (info->jedec_id == jedec) { 800 - DEBUG(MTD_DEBUG_LEVEL1, "%s: OTP, sector protect%s\n", 800 + pr_debug("%s: OTP, sector protect%s\n", 801 801 dev_name(&spi->dev), 802 802 (info->flags & SUP_POW2PS) 803 803 ? ", binary pagesize" : "" ··· 805 805 if (info->flags & SUP_POW2PS) { 806 806 status = dataflash_status(spi); 807 807 if (status < 0) { 808 - DEBUG(MTD_DEBUG_LEVEL1, 809 - "%s: status error %d\n", 808 + pr_debug("%s: status error %d\n", 810 809 dev_name(&spi->dev), status); 811 810 return ERR_PTR(status); 812 811 } ··· 870 871 */ 871 872 status = dataflash_status(spi); 872 873 if (status <= 0 || status == 0xff) { 873 - DEBUG(MTD_DEBUG_LEVEL1, "%s: status error %d\n", 874 + pr_debug("%s: status error %d\n", 874 875 dev_name(&spi->dev), status); 875 876 if (status == 0 || status == 0xff) 876 877 status = -ENODEV; ··· 906 907 break; 907 908 /* obsolete AT45DB1282 not (yet?) supported */ 908 909 default: 909 - DEBUG(MTD_DEBUG_LEVEL1, "%s: unsupported device (%x)\n", 910 + pr_debug("%s: unsupported device (%x)\n", 910 911 dev_name(&spi->dev), status & 0x3c); 911 912 status = -ENODEV; 912 913 } 913 914 914 915 if (status < 0) 915 - DEBUG(MTD_DEBUG_LEVEL1, "%s: add_dataflash --> %d\n", 916 + pr_debug("%s: add_dataflash --> %d\n", 916 917 dev_name(&spi->dev), status); 917 918 918 919 return status; ··· 923 924 struct dataflash *flash = dev_get_drvdata(&spi->dev); 924 925 int status; 925 926 926 - DEBUG(MTD_DEBUG_LEVEL1, "%s: remove\n", dev_name(&spi->dev)); 927 + pr_debug("%s: remove\n", dev_name(&spi->dev)); 927 928 928 929 status = mtd_device_unregister(&flash->mtd); 929 930 if (status == 0) {
+1 -2
drivers/mtd/devices/sst25l.c
··· 410 410 dev_info(&spi->dev, "%s (%lld KiB)\n", flash_info->name, 411 411 (long long)flash->mtd.size >> 10); 412 412 413 - DEBUG(MTD_DEBUG_LEVEL2, 414 - "mtd .name = %s, .size = 0x%llx (%lldMiB) " 413 + pr_debug("mtd .name = %s, .size = 0x%llx (%lldMiB) " 415 414 ".erasesize = 0x%.8x (%uKiB) .numeraseregions = %d\n", 416 415 flash->mtd.name, 417 416 (long long)flash->mtd.size, (long long)(flash->mtd.size >> 20),
+19 -19
drivers/mtd/ftl.c
··· 339 339 struct erase_info *erase; 340 340 341 341 xfer = &part->XferInfo[xfernum]; 342 - DEBUG(1, "ftl_cs: erasing xfer unit at 0x%x\n", xfer->Offset); 342 + pr_debug("ftl_cs: erasing xfer unit at 0x%x\n", xfer->Offset); 343 343 xfer->state = XFER_ERASING; 344 344 345 345 /* Is there a free erase slot? Always in MTD. */ ··· 415 415 xfer = &part->XferInfo[i]; 416 416 xfer->state = XFER_FAILED; 417 417 418 - DEBUG(1, "ftl_cs: preparing xfer unit at 0x%x\n", xfer->Offset); 418 + pr_debug("ftl_cs: preparing xfer unit at 0x%x\n", xfer->Offset); 419 419 420 420 /* Write the transfer unit header */ 421 421 header = part->header; ··· 476 476 477 477 eun = &part->EUNInfo[srcunit]; 478 478 xfer = &part->XferInfo[xferunit]; 479 - DEBUG(2, "ftl_cs: copying block 0x%x to 0x%x\n", 479 + pr_debug("ftl_cs: copying block 0x%x to 0x%x\n", 480 480 eun->Offset, xfer->Offset); 481 481 482 482 ··· 609 609 uint32_t best; 610 610 int queued, ret; 611 611 612 - DEBUG(0, "ftl_cs: reclaiming space...\n"); 613 - DEBUG(3, "NumTransferUnits == %x\n", part->header.NumTransferUnits); 612 + pr_debug("ftl_cs: reclaiming space...\n"); 613 + pr_debug("NumTransferUnits == %x\n", part->header.NumTransferUnits); 614 614 /* Pick the least erased transfer unit */ 615 615 best = 0xffffffff; xfer = 0xffff; 616 616 do { ··· 618 618 for (i = 0; i < part->header.NumTransferUnits; i++) { 619 619 int n=0; 620 620 if (part->XferInfo[i].state == XFER_UNKNOWN) { 621 - DEBUG(3,"XferInfo[%d].state == XFER_UNKNOWN\n",i); 621 + pr_debug("XferInfo[%d].state == XFER_UNKNOWN\n",i); 622 622 n=1; 623 623 erase_xfer(part, i); 624 624 } 625 625 if (part->XferInfo[i].state == XFER_ERASING) { 626 - DEBUG(3,"XferInfo[%d].state == XFER_ERASING\n",i); 626 + pr_debug("XferInfo[%d].state == XFER_ERASING\n",i); 627 627 n=1; 628 628 queued = 1; 629 629 } 630 630 else if (part->XferInfo[i].state == XFER_ERASED) { 631 - DEBUG(3,"XferInfo[%d].state == XFER_ERASED\n",i); 631 + pr_debug("XferInfo[%d].state == XFER_ERASED\n",i); 632 632 n=1; 633 633 prepare_xfer(part, i); 634 634 } 635 635 if (part->XferInfo[i].state == XFER_PREPARED) { 636 - DEBUG(3,"XferInfo[%d].state == XFER_PREPARED\n",i); 636 + pr_debug("XferInfo[%d].state == XFER_PREPARED\n",i); 637 637 n=1; 638 638 if (part->XferInfo[i].EraseCount <= best) { 639 639 best = part->XferInfo[i].EraseCount; ··· 641 641 } 642 642 } 643 643 if (!n) 644 - DEBUG(3,"XferInfo[%d].state == %x\n",i, part->XferInfo[i].state); 644 + pr_debug("XferInfo[%d].state == %x\n",i, part->XferInfo[i].state); 645 645 646 646 } 647 647 if (xfer == 0xffff) { 648 648 if (queued) { 649 - DEBUG(1, "ftl_cs: waiting for transfer " 649 + pr_debug("ftl_cs: waiting for transfer " 650 650 "unit to be prepared...\n"); 651 651 if (part->mbd.mtd->sync) 652 652 part->mbd.mtd->sync(part->mbd.mtd); ··· 656 656 printk(KERN_NOTICE "ftl_cs: reclaim failed: no " 657 657 "suitable transfer units!\n"); 658 658 else 659 - DEBUG(1, "ftl_cs: reclaim failed: no " 659 + pr_debug("ftl_cs: reclaim failed: no " 660 660 "suitable transfer units!\n"); 661 661 662 662 return -EIO; ··· 666 666 667 667 eun = 0; 668 668 if ((jiffies % shuffle_freq) == 0) { 669 - DEBUG(1, "ftl_cs: recycling freshest block...\n"); 669 + pr_debug("ftl_cs: recycling freshest block...\n"); 670 670 best = 0xffffffff; 671 671 for (i = 0; i < part->DataUnits; i++) 672 672 if (part->EUNInfo[i].EraseCount <= best) { ··· 686 686 printk(KERN_NOTICE "ftl_cs: reclaim failed: " 687 687 "no free blocks!\n"); 688 688 else 689 - DEBUG(1,"ftl_cs: reclaim failed: " 689 + pr_debug("ftl_cs: reclaim failed: " 690 690 "no free blocks!\n"); 691 691 692 692 return -EIO; ··· 771 771 printk(KERN_NOTICE "ftl_cs: bad free list!\n"); 772 772 return 0; 773 773 } 774 - DEBUG(2, "ftl_cs: found free block at %d in %d\n", blk, eun); 774 + pr_debug("ftl_cs: found free block at %d in %d\n", blk, eun); 775 775 return blk; 776 776 777 777 } /* find_free */ ··· 791 791 int ret; 792 792 size_t offset, retlen; 793 793 794 - DEBUG(2, "ftl_cs: ftl_read(0x%p, 0x%lx, %ld)\n", 794 + pr_debug("ftl_cs: ftl_read(0x%p, 0x%lx, %ld)\n", 795 795 part, sector, nblocks); 796 796 if (!(part->state & FTL_FORMATTED)) { 797 797 printk(KERN_NOTICE "ftl_cs: bad partition\n"); ··· 840 840 int ret; 841 841 size_t retlen, offset; 842 842 843 - DEBUG(2, "ftl_cs: set_bam_entry(0x%p, 0x%x, 0x%x)\n", 843 + pr_debug("ftl_cs: set_bam_entry(0x%p, 0x%x, 0x%x)\n", 844 844 part, log_addr, virt_addr); 845 845 bsize = 1 << part->header.EraseUnitSize; 846 846 eun = log_addr / bsize; ··· 905 905 int ret; 906 906 size_t retlen, offset; 907 907 908 - DEBUG(2, "ftl_cs: ftl_write(0x%p, %ld, %ld)\n", 908 + pr_debug("ftl_cs: ftl_write(0x%p, %ld, %ld)\n", 909 909 part, sector, nblocks); 910 910 if (!(part->state & FTL_FORMATTED)) { 911 911 printk(KERN_NOTICE "ftl_cs: bad partition\n"); ··· 1011 1011 partition_t *part = (void *)dev; 1012 1012 uint32_t bsize = 1 << part->header.EraseUnitSize; 1013 1013 1014 - DEBUG(1, "FTL erase sector %ld for %d sectors\n", 1014 + pr_debug("FTL erase sector %ld for %d sectors\n", 1015 1015 sector, nr_sects); 1016 1016 1017 1017 while (nr_sects) {
+19 -19
drivers/mtd/inftlcore.c
··· 63 63 return; 64 64 } 65 65 66 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: add_mtd for %s\n", mtd->name); 66 + pr_debug("INFTL: add_mtd for %s\n", mtd->name); 67 67 68 68 inftl = kzalloc(sizeof(*inftl), GFP_KERNEL); 69 69 ··· 131 131 { 132 132 struct INFTLrecord *inftl = (void *)dev; 133 133 134 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: remove_dev (i=%d)\n", dev->devnum); 134 + pr_debug("INFTL: remove_dev (i=%d)\n", dev->devnum); 135 135 136 136 del_mtd_blktrans_dev(dev); 137 137 ··· 213 213 u16 pot = inftl->LastFreeEUN; 214 214 int silly = inftl->nb_blocks; 215 215 216 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findfreeblock(inftl=%p," 216 + pr_debug("INFTL: INFTL_findfreeblock(inftl=%p," 217 217 "desperate=%d)\n", inftl, desperate); 218 218 219 219 /* ··· 221 221 * blocks completely. 222 222 */ 223 223 if (!desperate && inftl->numfreeEUNs < 2) { 224 - DEBUG(MTD_DEBUG_LEVEL1, "INFTL: there are too few free " 224 + pr_debug("INFTL: there are too few free " 225 225 "EUNs (%d)\n", inftl->numfreeEUNs); 226 226 return BLOCK_NIL; 227 227 } ··· 257 257 struct inftl_oob oob; 258 258 size_t retlen; 259 259 260 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d," 260 + pr_debug("INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d," 261 261 "pending=%d)\n", inftl, thisVUC, pendingblock); 262 262 263 263 memset(BlockMap, 0xff, sizeof(BlockMap)); ··· 321 321 * Chain, and the Erase Unit into which we are supposed to be copying. 322 322 * Go for it. 323 323 */ 324 - DEBUG(MTD_DEBUG_LEVEL1, "INFTL: folding chain %d into unit %d\n", 324 + pr_debug("INFTL: folding chain %d into unit %d\n", 325 325 thisVUC, targetEUN); 326 326 327 327 for (block = 0; block < inftl->EraseSize/SECTORSIZE ; block++) { ··· 353 353 (block * SECTORSIZE), SECTORSIZE, 354 354 &retlen, movebuf); 355 355 if (ret != -EIO) 356 - DEBUG(MTD_DEBUG_LEVEL1, "INFTL: error went " 356 + pr_debug("INFTL: error went " 357 357 "away on retry?\n"); 358 358 } 359 359 memset(&oob, 0xff, sizeof(struct inftl_oob)); ··· 370 370 * is important, by doing oldest first if we crash/reboot then it 371 371 * it is relatively simple to clean up the mess). 372 372 */ 373 - DEBUG(MTD_DEBUG_LEVEL1, "INFTL: want to erase virtual chain %d\n", 373 + pr_debug("INFTL: want to erase virtual chain %d\n", 374 374 thisVUC); 375 375 376 376 for (;;) { ··· 419 419 u16 ChainLength = 0, thislen; 420 420 u16 chain, EUN; 421 421 422 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_makefreeblock(inftl=%p," 422 + pr_debug("INFTL: INFTL_makefreeblock(inftl=%p," 423 423 "pending=%d)\n", inftl, pendingblock); 424 424 425 425 for (chain = 0; chain < inftl->nb_blocks; chain++) { ··· 482 482 size_t retlen; 483 483 int silly, silly2 = 3; 484 484 485 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findwriteunit(inftl=%p," 485 + pr_debug("INFTL: INFTL_findwriteunit(inftl=%p," 486 486 "block=%d)\n", inftl, block); 487 487 488 488 do { ··· 499 499 blockofs, 8, &retlen, (char *)&bci); 500 500 501 501 status = bci.Status | bci.Status1; 502 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: status of block %d in " 502 + pr_debug("INFTL: status of block %d in " 503 503 "EUN %d is %x\n", block , writeEUN, status); 504 504 505 505 switch(status) { ··· 553 553 * Hopefully we free something, lets try again. 554 554 * This time we are desperate... 555 555 */ 556 - DEBUG(MTD_DEBUG_LEVEL1, "INFTL: using desperate==1 " 556 + pr_debug("INFTL: using desperate==1 " 557 557 "to find free EUN to accommodate write to " 558 558 "VUC %d\n", thisVUC); 559 559 writeEUN = INFTL_findfreeblock(inftl, 1); ··· 645 645 struct inftl_bci bci; 646 646 size_t retlen; 647 647 648 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_trydeletechain(inftl=%p," 648 + pr_debug("INFTL: INFTL_trydeletechain(inftl=%p," 649 649 "thisVUC=%d)\n", inftl, thisVUC); 650 650 651 651 memset(BlockUsed, 0, sizeof(BlockUsed)); ··· 709 709 * For each block in the chain free it and make it available 710 710 * for future use. Erase from the oldest unit first. 711 711 */ 712 - DEBUG(MTD_DEBUG_LEVEL1, "INFTL: deleting empty VUC %d\n", thisVUC); 712 + pr_debug("INFTL: deleting empty VUC %d\n", thisVUC); 713 713 714 714 for (;;) { 715 715 u16 *prevEUN = &inftl->VUtable[thisVUC]; ··· 717 717 718 718 /* If the chain is all gone already, we're done */ 719 719 if (thisEUN == BLOCK_NIL) { 720 - DEBUG(MTD_DEBUG_LEVEL2, "INFTL: Empty VUC %d for deletion was already absent\n", thisEUN); 720 + pr_debug("INFTL: Empty VUC %d for deletion was already absent\n", thisEUN); 721 721 return; 722 722 } 723 723 ··· 729 729 thisEUN = *prevEUN; 730 730 } 731 731 732 - DEBUG(MTD_DEBUG_LEVEL3, "Deleting EUN %d from VUC %d\n", 732 + pr_debug("Deleting EUN %d from VUC %d\n", 733 733 thisEUN, thisVUC); 734 734 735 735 if (INFTL_formatblock(inftl, thisEUN) < 0) { ··· 765 765 size_t retlen; 766 766 struct inftl_bci bci; 767 767 768 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_deleteblock(inftl=%p," 768 + pr_debug("INFTL: INFTL_deleteblock(inftl=%p," 769 769 "block=%d)\n", inftl, block); 770 770 771 771 while (thisEUN < inftl->nb_blocks) { ··· 824 824 struct inftl_oob oob; 825 825 char *p, *pend; 826 826 827 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_writeblock(inftl=%p,block=%ld," 827 + pr_debug("INFTL: inftl_writeblock(inftl=%p,block=%ld," 828 828 "buffer=%p)\n", inftl, block, buffer); 829 829 830 830 /* Is block all zero? */ ··· 874 874 struct inftl_bci bci; 875 875 size_t retlen; 876 876 877 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_readblock(inftl=%p,block=%ld," 877 + pr_debug("INFTL: inftl_readblock(inftl=%p,block=%ld," 878 878 "buffer=%p)\n", inftl, block, buffer); 879 879 880 880 while (thisEUN < inftl->nb_blocks) {
+6 -6
drivers/mtd/inftlmount.c
··· 53 53 struct INFTLPartition *ip; 54 54 size_t retlen; 55 55 56 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: find_boot_record(inftl=%p)\n", inftl); 56 + pr_debug("INFTL: find_boot_record(inftl=%p)\n", inftl); 57 57 58 58 /* 59 59 * Assume logical EraseSize == physical erasesize for starting the ··· 385 385 struct mtd_info *mtd = inftl->mbd.mtd; 386 386 int physblock; 387 387 388 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_formatblock(inftl=%p," 388 + pr_debug("INFTL: INFTL_formatblock(inftl=%p," 389 389 "block=%d)\n", inftl, block); 390 390 391 391 memset(instr, 0, sizeof(struct erase_info)); ··· 555 555 int i; 556 556 u8 *ANACtable, ANAC; 557 557 558 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_mount(inftl=%p)\n", s); 558 + pr_debug("INFTL: INFTL_mount(inftl=%p)\n", s); 559 559 560 560 /* Search for INFTL MediaHeader and Spare INFTL Media Header */ 561 561 if (find_boot_record(s) < 0) { ··· 585 585 * NOTEXPLORED state. Then at the end we will try to format it and 586 586 * mark it as free. 587 587 */ 588 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: pass 1, explore each unit\n"); 588 + pr_debug("INFTL: pass 1, explore each unit\n"); 589 589 for (first_block = s->firstEUN; first_block <= s->lastEUN; first_block++) { 590 590 if (s->PUtable[first_block] != BLOCK_NOTEXPLORED) 591 591 continue; ··· 727 727 * possible because we don't update the previous pointers when 728 728 * we fold chains. No big deal, just fix them up in PUtable. 729 729 */ 730 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: pass 2, validate virtual chains\n"); 730 + pr_debug("INFTL: pass 2, validate virtual chains\n"); 731 731 for (logical_block = 0; logical_block < s->numvunits; logical_block++) { 732 732 block = s->VUtable[logical_block]; 733 733 last_block = BLOCK_NIL; ··· 785 785 s->numfreeEUNs = 0; 786 786 s->LastFreeEUN = BLOCK_NIL; 787 787 788 - DEBUG(MTD_DEBUG_LEVEL3, "INFTL: pass 3, format unused blocks\n"); 788 + pr_debug("INFTL: pass 3, format unused blocks\n"); 789 789 for (block = s->firstEUN; block <= s->lastEUN; block++) { 790 790 if (s->PUtable[block] == BLOCK_NOTEXPLORED) { 791 791 printk("INFTL: unreferenced block %d, formatting it\n",
+7 -7
drivers/mtd/mtdblock.c
··· 119 119 if (mtdblk->cache_state != STATE_DIRTY) 120 120 return 0; 121 121 122 - DEBUG(MTD_DEBUG_LEVEL2, "mtdblock: writing cached data for \"%s\" " 122 + pr_debug("mtdblock: writing cached data for \"%s\" " 123 123 "at 0x%lx, size 0x%x\n", mtd->name, 124 124 mtdblk->cache_offset, mtdblk->cache_size); 125 125 ··· 148 148 size_t retlen; 149 149 int ret; 150 150 151 - DEBUG(MTD_DEBUG_LEVEL2, "mtdblock: write on \"%s\" at 0x%lx, size 0x%x\n", 151 + pr_debug("mtdblock: write on \"%s\" at 0x%lx, size 0x%x\n", 152 152 mtd->name, pos, len); 153 153 154 154 if (!sect_size) ··· 218 218 size_t retlen; 219 219 int ret; 220 220 221 - DEBUG(MTD_DEBUG_LEVEL2, "mtdblock: read on \"%s\" at 0x%lx, size 0x%x\n", 221 + pr_debug("mtdblock: read on \"%s\" at 0x%lx, size 0x%x\n", 222 222 mtd->name, pos, len); 223 223 224 224 if (!sect_size) ··· 283 283 { 284 284 struct mtdblk_dev *mtdblk = container_of(mbd, struct mtdblk_dev, mbd); 285 285 286 - DEBUG(MTD_DEBUG_LEVEL1,"mtdblock_open\n"); 286 + pr_debug("mtdblock_open\n"); 287 287 288 288 mutex_lock(&mtdblks_lock); 289 289 if (mtdblk->count) { ··· 303 303 304 304 mutex_unlock(&mtdblks_lock); 305 305 306 - DEBUG(MTD_DEBUG_LEVEL1, "ok\n"); 306 + pr_debug("ok\n"); 307 307 308 308 return 0; 309 309 } ··· 312 312 { 313 313 struct mtdblk_dev *mtdblk = container_of(mbd, struct mtdblk_dev, mbd); 314 314 315 - DEBUG(MTD_DEBUG_LEVEL1, "mtdblock_release\n"); 315 + pr_debug("mtdblock_release\n"); 316 316 317 317 mutex_lock(&mtdblks_lock); 318 318 ··· 329 329 330 330 mutex_unlock(&mtdblks_lock); 331 331 332 - DEBUG(MTD_DEBUG_LEVEL1, "ok\n"); 332 + pr_debug("ok\n"); 333 333 334 334 return 0; 335 335 }
+5 -5
drivers/mtd/mtdchar.c
··· 86 86 struct mtd_file_info *mfi; 87 87 struct inode *mtd_ino; 88 88 89 - DEBUG(MTD_DEBUG_LEVEL0, "MTD_open\n"); 89 + pr_debug("MTD_open\n"); 90 90 91 91 /* You can't open the RO devices RW */ 92 92 if ((file->f_mode & FMODE_WRITE) && (minor & 1)) ··· 151 151 struct mtd_file_info *mfi = file->private_data; 152 152 struct mtd_info *mtd = mfi->mtd; 153 153 154 - DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n"); 154 + pr_debug("MTD_close\n"); 155 155 156 156 /* Only sync if opened RW */ 157 157 if ((file->f_mode & FMODE_WRITE) && mtd->sync) ··· 195 195 size_t size = count; 196 196 char *kbuf; 197 197 198 - DEBUG(MTD_DEBUG_LEVEL0,"MTD_read\n"); 198 + pr_debug("MTD_read\n"); 199 199 200 200 if (*ppos + count > mtd->size) 201 201 count = mtd->size - *ppos; ··· 278 278 int ret=0; 279 279 int len; 280 280 281 - DEBUG(MTD_DEBUG_LEVEL0,"MTD_write\n"); 281 + pr_debug("MTD_write\n"); 282 282 283 283 if (*ppos == mtd->size) 284 284 return -ENOSPC; ··· 570 570 u_long size; 571 571 struct mtd_info_user info; 572 572 573 - DEBUG(MTD_DEBUG_LEVEL0, "MTD_ioctl\n"); 573 + pr_debug("MTD_ioctl\n"); 574 574 575 575 size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT; 576 576 if (cmd & IOC_IN) {
+1 -1
drivers/mtd/mtdcore.c
··· 362 362 MTD_DEVT(i) + 1, 363 363 NULL, "mtd%dro", i); 364 364 365 - DEBUG(0, "mtd: Giving out device %d to %s\n", i, mtd->name); 365 + pr_debug("mtd: Giving out device %d to %s\n", i, mtd->name); 366 366 /* No need to get a refcount on the module containing 367 367 the notifier, since we hold the mtd_table_mutex */ 368 368 list_for_each_entry(not, &mtd_notifiers, list)
+10 -10
drivers/mtd/mtdsuper.c
··· 26 26 struct mtd_info *mtd = _mtd; 27 27 28 28 if (sb->s_mtd == mtd) { 29 - DEBUG(2, "MTDSB: Match on device %d (\"%s\")\n", 29 + pr_debug("MTDSB: Match on device %d (\"%s\")\n", 30 30 mtd->index, mtd->name); 31 31 return 1; 32 32 } 33 33 34 - DEBUG(2, "MTDSB: No match, device %d (\"%s\"), device %d (\"%s\")\n", 34 + pr_debug("MTDSB: No match, device %d (\"%s\"), device %d (\"%s\")\n", 35 35 sb->s_mtd->index, sb->s_mtd->name, mtd->index, mtd->name); 36 36 return 0; 37 37 } ··· 70 70 goto already_mounted; 71 71 72 72 /* fresh new superblock */ 73 - DEBUG(1, "MTDSB: New superblock for device %d (\"%s\")\n", 73 + pr_debug("MTDSB: New superblock for device %d (\"%s\")\n", 74 74 mtd->index, mtd->name); 75 75 76 76 sb->s_flags = flags; ··· 87 87 88 88 /* new mountpoint for an already mounted superblock */ 89 89 already_mounted: 90 - DEBUG(1, "MTDSB: Device %d (\"%s\") is already mounted\n", 90 + pr_debug("MTDSB: Device %d (\"%s\") is already mounted\n", 91 91 mtd->index, mtd->name); 92 92 put_mtd_device(mtd); 93 93 return dget(sb->s_root); ··· 108 108 109 109 mtd = get_mtd_device(NULL, mtdnr); 110 110 if (IS_ERR(mtd)) { 111 - DEBUG(0, "MTDSB: Device #%u doesn't appear to exist\n", mtdnr); 111 + pr_debug("MTDSB: Device #%u doesn't appear to exist\n", mtdnr); 112 112 return ERR_CAST(mtd); 113 113 } 114 114 ··· 131 131 if (!dev_name) 132 132 return ERR_PTR(-EINVAL); 133 133 134 - DEBUG(2, "MTDSB: dev_name \"%s\"\n", dev_name); 134 + pr_debug("MTDSB: dev_name \"%s\"\n", dev_name); 135 135 136 136 /* the preferred way of mounting in future; especially when 137 137 * CONFIG_BLOCK=n - we specify the underlying MTD device by number or ··· 142 142 struct mtd_info *mtd; 143 143 144 144 /* mount by MTD device name */ 145 - DEBUG(1, "MTDSB: mtd:%%s, name \"%s\"\n", 145 + pr_debug("MTDSB: mtd:%%s, name \"%s\"\n", 146 146 dev_name + 4); 147 147 148 148 mtd = get_mtd_device_nm(dev_name + 4); ··· 163 163 mtdnr = simple_strtoul(dev_name + 3, &endptr, 0); 164 164 if (!*endptr) { 165 165 /* It was a valid number */ 166 - DEBUG(1, "MTDSB: mtd%%d, mtdnr %d\n", 166 + pr_debug("MTDSB: mtd%%d, mtdnr %d\n", 167 167 mtdnr); 168 168 return mount_mtd_nr(fs_type, flags, 169 169 dev_name, data, ··· 179 179 bdev = lookup_bdev(dev_name); 180 180 if (IS_ERR(bdev)) { 181 181 ret = PTR_ERR(bdev); 182 - DEBUG(1, "MTDSB: lookup_bdev() returned %d\n", ret); 182 + pr_debug("MTDSB: lookup_bdev() returned %d\n", ret); 183 183 return ERR_PTR(ret); 184 184 } 185 - DEBUG(1, "MTDSB: lookup_bdev() returned 0\n"); 185 + pr_debug("MTDSB: lookup_bdev() returned 0\n"); 186 186 187 187 ret = -EINVAL; 188 188
+6 -8
drivers/mtd/nand/mxc_nand.c
··· 349 349 udelay(1); 350 350 } 351 351 if (max_retries < 0) 352 - DEBUG(MTD_DEBUG_LEVEL0, "%s: INT not set\n", 352 + pr_debug("%s: INT not set\n", 353 353 __func__); 354 354 } 355 355 } ··· 370 370 * waits for completion. */ 371 371 static void send_cmd_v1_v2(struct mxc_nand_host *host, uint16_t cmd, int useirq) 372 372 { 373 - DEBUG(MTD_DEBUG_LEVEL3, "send_cmd(host, 0x%x, %d)\n", cmd, useirq); 373 + pr_debug("send_cmd(host, 0x%x, %d)\n", cmd, useirq); 374 374 375 375 writew(cmd, NFC_V1_V2_FLASH_CMD); 376 376 writew(NFC_CMD, NFC_V1_V2_CONFIG2); ··· 386 386 udelay(1); 387 387 } 388 388 if (max_retries < 0) 389 - DEBUG(MTD_DEBUG_LEVEL0, "%s: RESET failed\n", 389 + pr_debug("%s: RESET failed\n", 390 390 __func__); 391 391 } else { 392 392 /* Wait for operation to complete */ ··· 410 410 * a NAND command. */ 411 411 static void send_addr_v1_v2(struct mxc_nand_host *host, uint16_t addr, int islast) 412 412 { 413 - DEBUG(MTD_DEBUG_LEVEL3, "send_addr(host, 0x%x %d)\n", addr, islast); 413 + pr_debug("send_addr(host, 0x%x %d)\n", addr, islast); 414 414 415 415 writew(addr, NFC_V1_V2_FLASH_ADDR); 416 416 writew(NFC_ADDR, NFC_V1_V2_CONFIG2); ··· 560 560 uint16_t ecc_status = readw(NFC_V1_V2_ECC_STATUS_RESULT); 561 561 562 562 if (((ecc_status & 0x3) == 2) || ((ecc_status >> 2) == 2)) { 563 - DEBUG(MTD_DEBUG_LEVEL0, 564 - "MXC_NAND: HWECC uncorrectable 2-bit ECC error\n"); 563 + pr_debug("MXC_NAND: HWECC uncorrectable 2-bit ECC error\n"); 565 564 return -1; 566 565 } 567 566 ··· 930 931 struct nand_chip *nand_chip = mtd->priv; 931 932 struct mxc_nand_host *host = nand_chip->priv; 932 933 933 - DEBUG(MTD_DEBUG_LEVEL3, 934 - "mxc_nand_command (cmd = 0x%x, col = 0x%x, page = 0x%x)\n", 934 + pr_debug("mxc_nand_command (cmd = 0x%x, col = 0x%x, page = 0x%x)\n", 935 935 command, column, page_addr); 936 936 937 937 /* Reset command state information */
+36 -38
drivers/mtd/nand/nand_base.c
··· 113 113 114 114 /* Start address must align on block boundary */ 115 115 if (ofs & ((1 << chip->phys_erase_shift) - 1)) { 116 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Unaligned address\n", __func__); 116 + pr_debug("%s: unaligned address\n", __func__); 117 117 ret = -EINVAL; 118 118 } 119 119 120 120 /* Length must align on block boundary */ 121 121 if (len & ((1 << chip->phys_erase_shift) - 1)) { 122 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Length not block aligned\n", 123 - __func__); 122 + pr_debug("%s: length not block aligned\n", __func__); 124 123 ret = -EINVAL; 125 124 } 126 125 127 126 /* Do not allow past end of device */ 128 127 if (ofs + len > mtd->size) { 129 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Past end of device\n", 130 - __func__); 128 + pr_debug("%s: past end of device\n", __func__); 131 129 ret = -EINVAL; 132 130 } 133 131 ··· 911 913 status = chip->waitfunc(mtd, chip); 912 914 /* See if device thinks it succeeded */ 913 915 if (status & 0x01) { 914 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Error status = 0x%08x\n", 916 + pr_debug("%s: error status = 0x%08x\n", 915 917 __func__, status); 916 918 ret = -EIO; 917 919 } ··· 933 935 int chipnr; 934 936 struct nand_chip *chip = mtd->priv; 935 937 936 - DEBUG(MTD_DEBUG_LEVEL3, "%s: start = 0x%012llx, len = %llu\n", 938 + pr_debug("%s: start = 0x%012llx, len = %llu\n", 937 939 __func__, (unsigned long long)ofs, len); 938 940 939 941 if (check_offs_len(mtd, ofs, len)) ··· 952 954 953 955 /* Check, if it is write protected */ 954 956 if (nand_check_wp(mtd)) { 955 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Device is write protected!!!\n", 957 + pr_debug("%s: device is write protected!\n", 956 958 __func__); 957 959 ret = -EIO; 958 960 goto out; ··· 986 988 int chipnr, status, page; 987 989 struct nand_chip *chip = mtd->priv; 988 990 989 - DEBUG(MTD_DEBUG_LEVEL3, "%s: start = 0x%012llx, len = %llu\n", 991 + pr_debug("%s: start = 0x%012llx, len = %llu\n", 990 992 __func__, (unsigned long long)ofs, len); 991 993 992 994 if (check_offs_len(mtd, ofs, len)) ··· 1001 1003 1002 1004 /* Check, if it is write protected */ 1003 1005 if (nand_check_wp(mtd)) { 1004 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Device is write protected!!!\n", 1006 + pr_debug("%s: device is write protected!\n", 1005 1007 __func__); 1006 1008 status = MTD_ERASE_FAILED; 1007 1009 ret = -EIO; ··· 1016 1018 status = chip->waitfunc(mtd, chip); 1017 1019 /* See if device thinks it succeeded */ 1018 1020 if (status & 0x01) { 1019 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Error status = 0x%08x\n", 1021 + pr_debug("%s: error status = 0x%08x\n", 1020 1022 __func__, status); 1021 1023 ret = -EIO; 1022 1024 goto out; ··· 1754 1756 int len; 1755 1757 uint8_t *buf = ops->oobbuf; 1756 1758 1757 - DEBUG(MTD_DEBUG_LEVEL3, "%s: from = 0x%08Lx, len = %i\n", 1759 + pr_debug("%s: from = 0x%08Lx, len = %i\n", 1758 1760 __func__, (unsigned long long)from, readlen); 1759 1761 1760 1762 stats = mtd->ecc_stats; ··· 1765 1767 len = mtd->oobsize; 1766 1768 1767 1769 if (unlikely(ops->ooboffs >= len)) { 1768 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt to start read " 1769 - "outside oob\n", __func__); 1770 + pr_debug("%s: attempt to start read outside oob\n", 1771 + __func__); 1770 1772 return -EINVAL; 1771 1773 } 1772 1774 ··· 1774 1776 if (unlikely(from >= mtd->size || 1775 1777 ops->ooboffs + readlen > ((mtd->size >> chip->page_shift) - 1776 1778 (from >> chip->page_shift)) * len)) { 1777 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt read beyond end " 1778 - "of device\n", __func__); 1779 + pr_debug("%s: attempt to read beyond end of device\n", 1780 + __func__); 1779 1781 return -EINVAL; 1780 1782 } 1781 1783 ··· 1854 1856 1855 1857 /* Do not allow reads past end of device */ 1856 1858 if (ops->datbuf && (from + ops->len) > mtd->size) { 1857 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt read " 1858 - "beyond end of device\n", __func__); 1859 + pr_debug("%s: attempt to read beyond end of device\n", 1860 + __func__); 1859 1861 return -EINVAL; 1860 1862 } 1861 1863 ··· 2350 2352 int chipnr, page, status, len; 2351 2353 struct nand_chip *chip = mtd->priv; 2352 2354 2353 - DEBUG(MTD_DEBUG_LEVEL3, "%s: to = 0x%08x, len = %i\n", 2355 + pr_debug("%s: to = 0x%08x, len = %i\n", 2354 2356 __func__, (unsigned int)to, (int)ops->ooblen); 2355 2357 2356 2358 if (ops->mode == MTD_OOB_AUTO) ··· 2360 2362 2361 2363 /* Do not allow write past end of page */ 2362 2364 if ((ops->ooboffs + ops->ooblen) > len) { 2363 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt to write " 2364 - "past end of page\n", __func__); 2365 + pr_debug("%s: attempt to write past end of page\n", 2366 + __func__); 2365 2367 return -EINVAL; 2366 2368 } 2367 2369 2368 2370 if (unlikely(ops->ooboffs >= len)) { 2369 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt to start " 2370 - "write outside oob\n", __func__); 2371 + pr_debug("%s: attempt to start write outside oob\n", 2372 + __func__); 2371 2373 return -EINVAL; 2372 2374 } 2373 2375 ··· 2376 2378 ops->ooboffs + ops->ooblen > 2377 2379 ((mtd->size >> chip->page_shift) - 2378 2380 (to >> chip->page_shift)) * len)) { 2379 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt write beyond " 2380 - "end of device\n", __func__); 2381 + pr_debug("%s: attempt to write beyond end of device\n", 2382 + __func__); 2381 2383 return -EINVAL; 2382 2384 } 2383 2385 ··· 2430 2432 2431 2433 /* Do not allow writes past end of device */ 2432 2434 if (ops->datbuf && (to + ops->len) > mtd->size) { 2433 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt write beyond " 2434 - "end of device\n", __func__); 2435 + pr_debug("%s: attempt to write beyond end of device\n", 2436 + __func__); 2435 2437 return -EINVAL; 2436 2438 } 2437 2439 ··· 2520 2522 unsigned int bbt_masked_page = 0xffffffff; 2521 2523 loff_t len; 2522 2524 2523 - DEBUG(MTD_DEBUG_LEVEL3, "%s: start = 0x%012llx, len = %llu\n", 2524 - __func__, (unsigned long long)instr->addr, 2525 - (unsigned long long)instr->len); 2525 + pr_debug("%s: start = 0x%012llx, len = %llu\n", 2526 + __func__, (unsigned long long)instr->addr, 2527 + (unsigned long long)instr->len); 2526 2528 2527 2529 if (check_offs_len(mtd, instr->addr, instr->len)) 2528 2530 return -EINVAL; ··· 2544 2546 2545 2547 /* Check, if it is write protected */ 2546 2548 if (nand_check_wp(mtd)) { 2547 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Device is write protected!!!\n", 2548 - __func__); 2549 + pr_debug("%s: device is write protected!\n", 2550 + __func__); 2549 2551 instr->state = MTD_ERASE_FAILED; 2550 2552 goto erase_exit; 2551 2553 } ··· 2596 2598 2597 2599 /* See if block erase succeeded */ 2598 2600 if (status & NAND_STATUS_FAIL) { 2599 - DEBUG(MTD_DEBUG_LEVEL0, "%s: Failed erase, " 2600 - "page 0x%08x\n", __func__, page); 2601 + pr_debug("%s: failed erase, page 0x%08x\n", 2602 + __func__, page); 2601 2603 instr->state = MTD_ERASE_FAILED; 2602 2604 instr->fail_addr = 2603 2605 ((loff_t)page << chip->page_shift); ··· 2657 2659 if (!rewrite_bbt[chipnr]) 2658 2660 continue; 2659 2661 /* Update the BBT for chip */ 2660 - DEBUG(MTD_DEBUG_LEVEL0, "%s: nand_update_bbt " 2661 - "(%d:0x%0llx 0x%0x)\n", __func__, chipnr, 2662 - rewrite_bbt[chipnr], chip->bbt_td->pages[chipnr]); 2662 + pr_debug("%s: nand_update_bbt (%d:0x%0llx 0x%0x)\n", 2663 + __func__, chipnr, rewrite_bbt[chipnr], 2664 + chip->bbt_td->pages[chipnr]); 2663 2665 nand_update_bbt(mtd, rewrite_bbt[chipnr]); 2664 2666 } 2665 2667 ··· 2677 2679 { 2678 2680 struct nand_chip *chip = mtd->priv; 2679 2681 2680 - DEBUG(MTD_DEBUG_LEVEL3, "%s: called\n", __func__); 2682 + pr_debug("%s: called\n", __func__); 2681 2683 2682 2684 /* Grab the lock and see if the device is available */ 2683 2685 nand_get_device(chip, mtd, FL_SYNCING);
+3 -2
drivers/mtd/nand/nand_bbt.c
··· 1383 1383 block = (int)(offs >> (this->bbt_erase_shift - 1)); 1384 1384 res = (this->bbt[block >> 3] >> (block & 0x06)) & 0x03; 1385 1385 1386 - DEBUG(MTD_DEBUG_LEVEL2, "nand_isbad_bbt(): bbt info for offs 0x%08x: (block %d) 0x%02x\n", 1387 - (unsigned int)offs, block >> 1, res); 1386 + pr_debug("nand_isbad_bbt(): bbt info for offs 0x%08x: " 1387 + "(block %d) 0x%02x\n", 1388 + (unsigned int)offs, block >> 1, res); 1388 1389 1389 1390 switch ((int)res) { 1390 1391 case 0x00:
+1 -1
drivers/mtd/nand/nand_bch.c
··· 93 93 buf[errloc[i] >> 3] ^= (1 << (errloc[i] & 7)); 94 94 /* else error in ecc, no action needed */ 95 95 96 - DEBUG(MTD_DEBUG_LEVEL0, "%s: corrected bitflip %u\n", 96 + pr_debug("%s: corrected bitflip %u\n", 97 97 __func__, errloc[i]); 98 98 } 99 99 } else if (count < 0) {
+4 -4
drivers/mtd/nand/omap2.c
··· 741 741 742 742 case 1: 743 743 /* Uncorrectable error */ 744 - DEBUG(MTD_DEBUG_LEVEL0, "ECC UNCORRECTED_ERROR 1\n"); 744 + pr_debug("ECC UNCORRECTED_ERROR 1\n"); 745 745 return -1; 746 746 747 747 case 11: 748 748 /* UN-Correctable error */ 749 - DEBUG(MTD_DEBUG_LEVEL0, "ECC UNCORRECTED_ERROR B\n"); 749 + pr_debug("ECC UNCORRECTED_ERROR B\n"); 750 750 return -1; 751 751 752 752 case 12: ··· 763 763 764 764 find_bit = (ecc_bit[5] << 2) + (ecc_bit[3] << 1) + ecc_bit[1]; 765 765 766 - DEBUG(MTD_DEBUG_LEVEL0, "Correcting single bit ECC error at " 766 + pr_debug("Correcting single bit ECC error at " 767 767 "offset: %d, bit: %d\n", find_byte, find_bit); 768 768 769 769 page_data[find_byte] ^= (1 << find_bit); ··· 776 776 ecc_data2[2] == 0) 777 777 return 0; 778 778 } 779 - DEBUG(MTD_DEBUG_LEVEL0, "UNCORRECTED_ERROR default\n"); 779 + pr_debug("UNCORRECTED_ERROR default\n"); 780 780 return -1; 781 781 } 782 782 }
+1 -1
drivers/mtd/nand/rtc_from4.c
··· 380 380 /* Let the library code do its magic. */ 381 381 res = decode_rs8(rs_decoder, (uint8_t *) buf, par, 512, syn, 0, NULL, 0xff, NULL); 382 382 if (res > 0) { 383 - DEBUG(MTD_DEBUG_LEVEL0, "rtc_from4_correct_data: " "ECC corrected %d errors on read\n", res); 383 + pr_debug("rtc_from4_correct_data: " "ECC corrected %d errors on read\n", res); 384 384 } 385 385 return res; 386 386 }
+11 -12
drivers/mtd/nftlcore.c
··· 63 63 return; 64 64 } 65 65 66 - DEBUG(MTD_DEBUG_LEVEL1, "NFTL: add_mtd for %s\n", mtd->name); 66 + pr_debug("NFTL: add_mtd for %s\n", mtd->name); 67 67 68 68 nftl = kzalloc(sizeof(struct NFTLrecord), GFP_KERNEL); 69 69 ··· 130 130 { 131 131 struct NFTLrecord *nftl = (void *)dev; 132 132 133 - DEBUG(MTD_DEBUG_LEVEL1, "NFTL: remove_dev (i=%d)\n", dev->devnum); 133 + pr_debug("NFTL: remove_dev (i=%d)\n", dev->devnum); 134 134 135 135 del_mtd_blktrans_dev(dev); 136 136 kfree(nftl->ReplUnitTable); ··· 218 218 219 219 /* Normally, we force a fold to happen before we run out of free blocks completely */ 220 220 if (!desperate && nftl->numfreeEUNs < 2) { 221 - DEBUG(MTD_DEBUG_LEVEL1, "NFTL_findfreeblock: there are too few free EUNs\n"); 221 + pr_debug("NFTL_findfreeblock: there are too few free EUNs\n"); 222 222 return BLOCK_NIL; 223 223 } 224 224 ··· 289 289 if (block == 2) { 290 290 foldmark = oob.u.c.FoldMark | oob.u.c.FoldMark1; 291 291 if (foldmark == FOLD_MARK_IN_PROGRESS) { 292 - DEBUG(MTD_DEBUG_LEVEL1, 293 - "Write Inhibited on EUN %d\n", thisEUN); 292 + pr_debug("Write Inhibited on EUN %d\n", thisEUN); 294 293 inplace = 0; 295 294 } else { 296 295 /* There's no other reason not to do inplace, ··· 354 355 if (BlockLastState[block] != SECTOR_FREE && 355 356 BlockMap[block] != BLOCK_NIL && 356 357 BlockMap[block] != targetEUN) { 357 - DEBUG(MTD_DEBUG_LEVEL1, "Setting inplace to 0. VUC %d, " 358 + pr_debug("Setting inplace to 0. VUC %d, " 358 359 "block %d was %x lastEUN, " 359 360 "and is in EUN %d (%s) %d\n", 360 361 thisVUC, block, BlockLastState[block], ··· 370 371 pendingblock < ((thisVUC + 1)* (nftl->EraseSize / 512)) && 371 372 BlockLastState[pendingblock - (thisVUC * (nftl->EraseSize / 512))] != 372 373 SECTOR_FREE) { 373 - DEBUG(MTD_DEBUG_LEVEL1, "Pending write not free in EUN %d. " 374 + pr_debug("Pending write not free in EUN %d. " 374 375 "Folding out of place.\n", targetEUN); 375 376 inplace = 0; 376 377 } 377 378 } 378 379 379 380 if (!inplace) { 380 - DEBUG(MTD_DEBUG_LEVEL1, "Cannot fold Virtual Unit Chain %d in place. " 381 + pr_debug("Cannot fold Virtual Unit Chain %d in place. " 381 382 "Trying out-of-place\n", thisVUC); 382 383 /* We need to find a targetEUN to fold into. */ 383 384 targetEUN = NFTL_findfreeblock(nftl, 1); ··· 407 408 and the Erase Unit into which we are supposed to be copying. 408 409 Go for it. 409 410 */ 410 - DEBUG(MTD_DEBUG_LEVEL1,"Folding chain %d into unit %d\n", thisVUC, targetEUN); 411 + pr_debug("Folding chain %d into unit %d\n", thisVUC, targetEUN); 411 412 for (block = 0; block < nftl->EraseSize / 512 ; block++) { 412 413 unsigned char movebuf[512]; 413 414 int ret; ··· 454 455 has duplicate chains, we need to free one of the chains because it's not necessary any more. 455 456 */ 456 457 thisEUN = nftl->EUNtable[thisVUC]; 457 - DEBUG(MTD_DEBUG_LEVEL1,"Want to erase\n"); 458 + pr_debug("Want to erase\n"); 458 459 459 460 /* For each block in the old chain (except the targetEUN of course), 460 461 free it and make it available for future use */ ··· 567 568 (writeEUN * nftl->EraseSize) + blockofs, 568 569 8, &retlen, (char *)&bci); 569 570 570 - DEBUG(MTD_DEBUG_LEVEL2, "Status of block %d in EUN %d is %x\n", 571 + pr_debug("Status of block %d in EUN %d is %x\n", 571 572 block , writeEUN, le16_to_cpu(bci.Status)); 572 573 573 574 status = bci.Status | bci.Status1; ··· 620 621 but they are reserved for when we're 621 622 desperate. Well, now we're desperate. 622 623 */ 623 - DEBUG(MTD_DEBUG_LEVEL1, "Using desperate==1 to find free EUN to accommodate write to VUC %d\n", thisVUC); 624 + pr_debug("Using desperate==1 to find free EUN to accommodate write to VUC %d\n", thisVUC); 624 625 writeEUN = NFTL_findfreeblock(nftl, 1); 625 626 } 626 627 if (writeEUN == BLOCK_NIL) {
+9 -9
drivers/mtd/onenand/onenand_base.c
··· 1122 1122 int ret = 0; 1123 1123 int writesize = this->writesize; 1124 1124 1125 - DEBUG(MTD_DEBUG_LEVEL3, "%s: from = 0x%08x, len = %i\n", 1125 + pr_debug("%s: from = 0x%08x, len = %i\n", 1126 1126 __func__, (unsigned int) from, (int) len); 1127 1127 1128 1128 if (ops->mode == MTD_OOB_AUTO) ··· 1226 1226 int ret = 0, boundary = 0; 1227 1227 int writesize = this->writesize; 1228 1228 1229 - DEBUG(MTD_DEBUG_LEVEL3, "%s: from = 0x%08x, len = %i\n", 1229 + pr_debug("%s: from = 0x%08x, len = %i\n", 1230 1230 __func__, (unsigned int) from, (int) len); 1231 1231 1232 1232 if (ops->mode == MTD_OOB_AUTO) ··· 1357 1357 1358 1358 from += ops->ooboffs; 1359 1359 1360 - DEBUG(MTD_DEBUG_LEVEL3, "%s: from = 0x%08x, len = %i\n", 1360 + pr_debug("%s: from = 0x%08x, len = %i\n", 1361 1361 __func__, (unsigned int) from, (int) len); 1362 1362 1363 1363 /* Initialize return length value */ ··· 1576 1576 size_t len = ops->ooblen; 1577 1577 u_char *buf = ops->oobbuf; 1578 1578 1579 - DEBUG(MTD_DEBUG_LEVEL3, "%s: from = 0x%08x, len = %zi\n", 1579 + pr_debug("%s: from = 0x%08x, len = %zi\n", 1580 1580 __func__, (unsigned int) from, len); 1581 1581 1582 1582 /* Initialize return value */ ··· 1750 1750 /* Wait for any existing operation to clear */ 1751 1751 onenand_panic_wait(mtd); 1752 1752 1753 - DEBUG(MTD_DEBUG_LEVEL3, "%s: to = 0x%08x, len = %i\n", 1753 + pr_debug("%s: to = 0x%08x, len = %i\n", 1754 1754 __func__, (unsigned int) to, (int) len); 1755 1755 1756 1756 /* Initialize retlen, in case of early exit */ ··· 1883 1883 u_char *oobbuf; 1884 1884 int ret = 0, cmd; 1885 1885 1886 - DEBUG(MTD_DEBUG_LEVEL3, "%s: to = 0x%08x, len = %i\n", 1886 + pr_debug("%s: to = 0x%08x, len = %i\n", 1887 1887 __func__, (unsigned int) to, (int) len); 1888 1888 1889 1889 /* Initialize retlen, in case of early exit */ ··· 2078 2078 2079 2079 to += ops->ooboffs; 2080 2080 2081 - DEBUG(MTD_DEBUG_LEVEL3, "%s: to = 0x%08x, len = %i\n", 2081 + pr_debug("%s: to = 0x%08x, len = %i\n", 2082 2082 __func__, (unsigned int) to, (int) len); 2083 2083 2084 2084 /* Initialize retlen, in case of early exit */ ··· 2489 2489 struct mtd_erase_region_info *region = NULL; 2490 2490 loff_t region_offset = 0; 2491 2491 2492 - DEBUG(MTD_DEBUG_LEVEL3, "%s: start=0x%012llx, len=%llu\n", __func__, 2492 + pr_debug("%s: start=0x%012llx, len=%llu\n", __func__, 2493 2493 (unsigned long long) instr->addr, (unsigned long long) instr->len); 2494 2494 2495 2495 /* Do not allow erase past end of device */ ··· 2558 2558 */ 2559 2559 static void onenand_sync(struct mtd_info *mtd) 2560 2560 { 2561 - DEBUG(MTD_DEBUG_LEVEL3, "%s: called\n", __func__); 2561 + pr_debug("%s: called\n", __func__); 2562 2562 2563 2563 /* Grab the lock and see if the device is available */ 2564 2564 onenand_get_device(mtd, FL_SYNCING);
+1 -1
drivers/mtd/onenand/onenand_bbt.c
··· 153 153 block = (int) (onenand_block(this, offs) << 1); 154 154 res = (bbm->bbt[block >> 3] >> (block & 0x06)) & 0x03; 155 155 156 - DEBUG(MTD_DEBUG_LEVEL2, "onenand_isbad_bbt: bbt info for offs 0x%08x: (block %d) 0x%02x\n", 156 + pr_debug("onenand_isbad_bbt: bbt info for offs 0x%08x: (block %d) 0x%02x\n", 157 157 (unsigned int) offs, block >> 1, res); 158 158 159 159 switch ((int) res) {
+13 -21
drivers/mtd/ssfdc.c
··· 135 135 /* Found */ 136 136 cis_sector = (int)(offset >> SECTOR_SHIFT); 137 137 } else { 138 - DEBUG(MTD_DEBUG_LEVEL1, 139 - "SSFDC_RO: CIS/IDI sector not found" 138 + pr_debug("SSFDC_RO: CIS/IDI sector not found" 140 139 " on %s (mtd%d)\n", mtd->name, 141 140 mtd->index); 142 141 } ··· 220 221 block_address >>= 1; 221 222 222 223 if (get_parity(block_address, 10) != parity) { 223 - DEBUG(MTD_DEBUG_LEVEL0, 224 - "SSFDC_RO: logical address field%d" 224 + pr_debug("SSFDC_RO: logical address field%d" 225 225 "parity error(0x%04X)\n", j+1, 226 226 block_address); 227 227 } else { ··· 233 235 if (!ok) 234 236 block_address = -2; 235 237 236 - DEBUG(MTD_DEBUG_LEVEL3, "SSFDC_RO: get_logical_address() %d\n", 238 + pr_debug("SSFDC_RO: get_logical_address() %d\n", 237 239 block_address); 238 240 239 241 return block_address; ··· 247 249 int ret, block_address, phys_block; 248 250 struct mtd_info *mtd = ssfdc->mbd.mtd; 249 251 250 - DEBUG(MTD_DEBUG_LEVEL1, "SSFDC_RO: build_block_map() nblks=%d (%luK)\n", 252 + pr_debug("SSFDC_RO: build_block_map() nblks=%d (%luK)\n", 251 253 ssfdc->map_len, 252 254 (unsigned long)ssfdc->map_len * ssfdc->erase_size / 1024); 253 255 ··· 260 262 261 263 ret = read_raw_oob(mtd, offset, oob_buf); 262 264 if (ret < 0) { 263 - DEBUG(MTD_DEBUG_LEVEL0, 264 - "SSFDC_RO: mtd read_oob() failed at %lu\n", 265 + pr_debug("SSFDC_RO: mtd read_oob() failed at %lu\n", 265 266 offset); 266 267 return -1; 267 268 } ··· 276 279 ssfdc->logic_block_map[block_address] = 277 280 (unsigned short)phys_block; 278 281 279 - DEBUG(MTD_DEBUG_LEVEL2, 280 - "SSFDC_RO: build_block_map() phys_block=%d," 282 + pr_debug("SSFDC_RO: build_block_map() phys_block=%d," 281 283 "logic_block_addr=%d, zone=%d\n", 282 284 phys_block, block_address, zone_index); 283 285 } ··· 312 316 ssfdc->erase_size = mtd->erasesize; 313 317 ssfdc->map_len = (u32)mtd->size / mtd->erasesize; 314 318 315 - DEBUG(MTD_DEBUG_LEVEL1, 316 - "SSFDC_RO: cis_block=%d,erase_size=%d,map_len=%d,n_zones=%d\n", 319 + pr_debug("SSFDC_RO: cis_block=%d,erase_size=%d,map_len=%d,n_zones=%d\n", 317 320 ssfdc->cis_block, ssfdc->erase_size, ssfdc->map_len, 318 321 DIV_ROUND_UP(ssfdc->map_len, MAX_PHYS_BLK_PER_ZONE)); 319 322 ··· 323 328 ssfdc->cylinders = (unsigned short)(((u32)mtd->size >> SECTOR_SHIFT) / 324 329 ((long)ssfdc->sectors * (long)ssfdc->heads)); 325 330 326 - DEBUG(MTD_DEBUG_LEVEL1, "SSFDC_RO: using C:%d H:%d S:%d == %ld sects\n", 331 + pr_debug("SSFDC_RO: using C:%d H:%d S:%d == %ld sects\n", 327 332 ssfdc->cylinders, ssfdc->heads , ssfdc->sectors, 328 333 (long)ssfdc->cylinders * (long)ssfdc->heads * 329 334 (long)ssfdc->sectors); ··· 360 365 { 361 366 struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev; 362 367 363 - DEBUG(MTD_DEBUG_LEVEL1, "SSFDC_RO: remove_dev (i=%d)\n", dev->devnum); 368 + pr_debug("SSFDC_RO: remove_dev (i=%d)\n", dev->devnum); 364 369 365 370 del_mtd_blktrans_dev(dev); 366 371 kfree(ssfdc->logic_block_map); ··· 376 381 offset = (int)(logic_sect_no % sectors_per_block); 377 382 block_address = (int)(logic_sect_no / sectors_per_block); 378 383 379 - DEBUG(MTD_DEBUG_LEVEL3, 380 - "SSFDC_RO: ssfdcr_readsect(%lu) sec_per_blk=%d, ofst=%d," 384 + pr_debug("SSFDC_RO: ssfdcr_readsect(%lu) sec_per_blk=%d, ofst=%d," 381 385 " block_addr=%d\n", logic_sect_no, sectors_per_block, offset, 382 386 block_address); 383 387 ··· 385 391 386 392 block_address = ssfdc->logic_block_map[block_address]; 387 393 388 - DEBUG(MTD_DEBUG_LEVEL3, 389 - "SSFDC_RO: ssfdcr_readsect() phys_block_addr=%d\n", 394 + pr_debug("SSFDC_RO: ssfdcr_readsect() phys_block_addr=%d\n", 390 395 block_address); 391 396 392 397 if (block_address < 0xffff) { ··· 394 401 sect_no = (unsigned long)block_address * sectors_per_block + 395 402 offset; 396 403 397 - DEBUG(MTD_DEBUG_LEVEL3, 398 - "SSFDC_RO: ssfdcr_readsect() phys_sect_no=%lu\n", 404 + pr_debug("SSFDC_RO: ssfdcr_readsect() phys_sect_no=%lu\n", 399 405 sect_no); 400 406 401 407 if (read_physical_sector(ssfdc->mbd.mtd, buf, sect_no) < 0) ··· 410 418 { 411 419 struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev; 412 420 413 - DEBUG(MTD_DEBUG_LEVEL1, "SSFDC_RO: ssfdcr_getgeo() C=%d, H=%d, S=%d\n", 421 + pr_debug("SSFDC_RO: ssfdcr_getgeo() C=%d, H=%d, S=%d\n", 414 422 ssfdc->cylinders, ssfdc->heads, ssfdc->sectors); 415 423 416 424 geo->heads = ssfdc->heads;