diff options
| author | vimal singh <vimalsingh@ti.com> | 2009-07-07 06:19:49 -0400 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-09-04 04:34:38 -0400 |
| commit | 20d8e2489d619ac4f14c46ca376655fc06b3c1ff (patch) | |
| tree | 2d2f14ab55fd8b2376de120a9f761556a2f29a1b | |
| parent | b8b3ee9aabbc3e6fc7ef025d861dd780b84eb6c5 (diff) | |
mtd: nand_base: use __func__ instead of typing names
Correcting debug prints by removing function names from print messages
and using '__func__' macro instead.
Function names were wrong in few places.
Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| -rw-r--r-- | drivers/mtd/nand/nand_base.c | 82 |
1 files changed, 42 insertions, 40 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 4a5a329711c4..268c9a4317bd 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
| @@ -1412,8 +1412,8 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from, | |||
| 1412 | int len; | 1412 | int len; |
| 1413 | uint8_t *buf = ops->oobbuf; | 1413 | uint8_t *buf = ops->oobbuf; |
| 1414 | 1414 | ||
| 1415 | DEBUG(MTD_DEBUG_LEVEL3, "nand_read_oob: from = 0x%08Lx, len = %i\n", | 1415 | DEBUG(MTD_DEBUG_LEVEL3, "%s: from = 0x%08Lx, len = %i\n", |
| 1416 | (unsigned long long)from, readlen); | 1416 | __func__, (unsigned long long)from, readlen); |
| 1417 | 1417 | ||
| 1418 | if (ops->mode == MTD_OOB_AUTO) | 1418 | if (ops->mode == MTD_OOB_AUTO) |
| 1419 | len = chip->ecc.layout->oobavail; | 1419 | len = chip->ecc.layout->oobavail; |
| @@ -1421,8 +1421,8 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from, | |||
| 1421 | len = mtd->oobsize; | 1421 | len = mtd->oobsize; |
| 1422 | 1422 | ||
| 1423 | if (unlikely(ops->ooboffs >= len)) { | 1423 | if (unlikely(ops->ooboffs >= len)) { |
| 1424 | DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: " | 1424 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt to start read " |
| 1425 | "Attempt to start read outside oob\n"); | 1425 | "outside oob\n", __func__); |
| 1426 | return -EINVAL; | 1426 | return -EINVAL; |
| 1427 | } | 1427 | } |
| 1428 | 1428 | ||
| @@ -1430,8 +1430,8 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from, | |||
| 1430 | if (unlikely(from >= mtd->size || | 1430 | if (unlikely(from >= mtd->size || |
| 1431 | ops->ooboffs + readlen > ((mtd->size >> chip->page_shift) - | 1431 | ops->ooboffs + readlen > ((mtd->size >> chip->page_shift) - |
| 1432 | (from >> chip->page_shift)) * len)) { | 1432 | (from >> chip->page_shift)) * len)) { |
| 1433 | DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: " | 1433 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt read beyond end " |
| 1434 | "Attempt read beyond end of device\n"); | 1434 | "of device\n", __func__); |
| 1435 | return -EINVAL; | 1435 | return -EINVAL; |
| 1436 | } | 1436 | } |
| 1437 | 1437 | ||
| @@ -1505,8 +1505,8 @@ static int nand_read_oob(struct mtd_info *mtd, loff_t from, | |||
| 1505 | 1505 | ||
| 1506 | /* Do not allow reads past end of device */ | 1506 | /* Do not allow reads past end of device */ |
| 1507 | if (ops->datbuf && (from + ops->len) > mtd->size) { | 1507 | if (ops->datbuf && (from + ops->len) > mtd->size) { |
| 1508 | DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: " | 1508 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt read " |
| 1509 | "Attempt read beyond end of device\n"); | 1509 | "beyond end of device\n", __func__); |
| 1510 | return -EINVAL; | 1510 | return -EINVAL; |
| 1511 | } | 1511 | } |
| 1512 | 1512 | ||
| @@ -1815,8 +1815,8 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to, | |||
| 1815 | 1815 | ||
| 1816 | /* reject writes, which are not page aligned */ | 1816 | /* reject writes, which are not page aligned */ |
| 1817 | if (NOTALIGNED(to) || NOTALIGNED(ops->len)) { | 1817 | if (NOTALIGNED(to) || NOTALIGNED(ops->len)) { |
| 1818 | printk(KERN_NOTICE "nand_write: " | 1818 | printk(KERN_NOTICE "%s: Attempt to write not " |
| 1819 | "Attempt to write not page aligned data\n"); | 1819 | "page aligned data\n", __func__); |
| 1820 | return -EINVAL; | 1820 | return -EINVAL; |
| 1821 | } | 1821 | } |
| 1822 | 1822 | ||
| @@ -1943,8 +1943,8 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to, | |||
| 1943 | int chipnr, page, status, len; | 1943 | int chipnr, page, status, len; |
| 1944 | struct nand_chip *chip = mtd->priv; | 1944 | struct nand_chip *chip = mtd->priv; |
| 1945 | 1945 | ||
| 1946 | DEBUG(MTD_DEBUG_LEVEL3, "nand_write_oob: to = 0x%08x, len = %i\n", | 1946 | DEBUG(MTD_DEBUG_LEVEL3, "%s: to = 0x%08x, len = %i\n", |
| 1947 | (unsigned int)to, (int)ops->ooblen); | 1947 | __func__, (unsigned int)to, (int)ops->ooblen); |
| 1948 | 1948 | ||
| 1949 | if (ops->mode == MTD_OOB_AUTO) | 1949 | if (ops->mode == MTD_OOB_AUTO) |
| 1950 | len = chip->ecc.layout->oobavail; | 1950 | len = chip->ecc.layout->oobavail; |
| @@ -1953,14 +1953,14 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to, | |||
| 1953 | 1953 | ||
| 1954 | /* Do not allow write past end of page */ | 1954 | /* Do not allow write past end of page */ |
| 1955 | if ((ops->ooboffs + ops->ooblen) > len) { | 1955 | if ((ops->ooboffs + ops->ooblen) > len) { |
| 1956 | DEBUG(MTD_DEBUG_LEVEL0, "nand_write_oob: " | 1956 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt to write " |
| 1957 | "Attempt to write past end of page\n"); | 1957 | "past end of page\n", __func__); |
| 1958 | return -EINVAL; | 1958 | return -EINVAL; |
| 1959 | } | 1959 | } |
| 1960 | 1960 | ||
| 1961 | if (unlikely(ops->ooboffs >= len)) { | 1961 | if (unlikely(ops->ooboffs >= len)) { |
| 1962 | DEBUG(MTD_DEBUG_LEVEL0, "nand_do_write_oob: " | 1962 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt to start " |
| 1963 | "Attempt to start write outside oob\n"); | 1963 | "write outside oob\n", __func__); |
| 1964 | return -EINVAL; | 1964 | return -EINVAL; |
| 1965 | } | 1965 | } |
| 1966 | 1966 | ||
| @@ -1969,8 +1969,8 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to, | |||
| 1969 | ops->ooboffs + ops->ooblen > | 1969 | ops->ooboffs + ops->ooblen > |
| 1970 | ((mtd->size >> chip->page_shift) - | 1970 | ((mtd->size >> chip->page_shift) - |
| 1971 | (to >> chip->page_shift)) * len)) { | 1971 | (to >> chip->page_shift)) * len)) { |
| 1972 | DEBUG(MTD_DEBUG_LEVEL0, "nand_do_write_oob: " | 1972 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt write beyond " |
| 1973 | "Attempt write beyond end of device\n"); | 1973 | "end of device\n", __func__); |
| 1974 | return -EINVAL; | 1974 | return -EINVAL; |
| 1975 | } | 1975 | } |
| 1976 | 1976 | ||
| @@ -2025,8 +2025,8 @@ static int nand_write_oob(struct mtd_info *mtd, loff_t to, | |||
| 2025 | 2025 | ||
| 2026 | /* Do not allow writes past end of device */ | 2026 | /* Do not allow writes past end of device */ |
| 2027 | if (ops->datbuf && (to + ops->len) > mtd->size) { | 2027 | if (ops->datbuf && (to + ops->len) > mtd->size) { |
| 2028 | DEBUG(MTD_DEBUG_LEVEL0, "nand_write_oob: " | 2028 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt write beyond " |
| 2029 | "Attempt write beyond end of device\n"); | 2029 | "end of device\n", __func__); |
| 2030 | return -EINVAL; | 2030 | return -EINVAL; |
| 2031 | } | 2031 | } |
| 2032 | 2032 | ||
| @@ -2116,26 +2116,27 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, | |||
| 2116 | unsigned int bbt_masked_page = 0xffffffff; | 2116 | unsigned int bbt_masked_page = 0xffffffff; |
| 2117 | loff_t len; | 2117 | loff_t len; |
| 2118 | 2118 | ||
| 2119 | DEBUG(MTD_DEBUG_LEVEL3, "nand_erase: start = 0x%012llx, len = %llu\n", | 2119 | DEBUG(MTD_DEBUG_LEVEL3, "%s: start = 0x%012llx, len = %llu\n", |
| 2120 | (unsigned long long)instr->addr, (unsigned long long)instr->len); | 2120 | __func__, (unsigned long long)instr->addr, |
| 2121 | (unsigned long long)instr->len); | ||
| 2121 | 2122 | ||
| 2122 | /* Start address must align on block boundary */ | 2123 | /* Start address must align on block boundary */ |
| 2123 | if (instr->addr & ((1 << chip->phys_erase_shift) - 1)) { | 2124 | if (instr->addr & ((1 << chip->phys_erase_shift) - 1)) { |
| 2124 | DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: Unaligned address\n"); | 2125 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Unaligned address\n", __func__); |
| 2125 | return -EINVAL; | 2126 | return -EINVAL; |
| 2126 | } | 2127 | } |
| 2127 | 2128 | ||
| 2128 | /* Length must align on block boundary */ | 2129 | /* Length must align on block boundary */ |
| 2129 | if (instr->len & ((1 << chip->phys_erase_shift) - 1)) { | 2130 | if (instr->len & ((1 << chip->phys_erase_shift) - 1)) { |
| 2130 | DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: " | 2131 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Length not block aligned\n", |
| 2131 | "Length not block aligned\n"); | 2132 | __func__); |
| 2132 | return -EINVAL; | 2133 | return -EINVAL; |
| 2133 | } | 2134 | } |
| 2134 | 2135 | ||
| 2135 | /* Do not allow erase past end of device */ | 2136 | /* Do not allow erase past end of device */ |
| 2136 | if ((instr->len + instr->addr) > mtd->size) { | 2137 | if ((instr->len + instr->addr) > mtd->size) { |
| 2137 | DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: " | 2138 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Erase past end of device\n", |
| 2138 | "Erase past end of device\n"); | 2139 | __func__); |
| 2139 | return -EINVAL; | 2140 | return -EINVAL; |
| 2140 | } | 2141 | } |
| 2141 | 2142 | ||
| @@ -2156,8 +2157,8 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, | |||
| 2156 | 2157 | ||
| 2157 | /* Check, if it is write protected */ | 2158 | /* Check, if it is write protected */ |
| 2158 | if (nand_check_wp(mtd)) { | 2159 | if (nand_check_wp(mtd)) { |
| 2159 | DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: " | 2160 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Device is write protected!!!\n", |
| 2160 | "Device is write protected!!!\n"); | 2161 | __func__); |
| 2161 | instr->state = MTD_ERASE_FAILED; | 2162 | instr->state = MTD_ERASE_FAILED; |
| 2162 | goto erase_exit; | 2163 | goto erase_exit; |
| 2163 | } | 2164 | } |
| @@ -2182,8 +2183,8 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, | |||
| 2182 | */ | 2183 | */ |
| 2183 | if (nand_block_checkbad(mtd, ((loff_t) page) << | 2184 | if (nand_block_checkbad(mtd, ((loff_t) page) << |
| 2184 | chip->page_shift, 0, allowbbt)) { | 2185 | chip->page_shift, 0, allowbbt)) { |
| 2185 | printk(KERN_WARNING "nand_erase: attempt to erase a " | 2186 | printk(KERN_WARNING "%s: attempt to erase a bad block " |
| 2186 | "bad block at page 0x%08x\n", page); | 2187 | "at page 0x%08x\n", __func__, page); |
| 2187 | instr->state = MTD_ERASE_FAILED; | 2188 | instr->state = MTD_ERASE_FAILED; |
| 2188 | goto erase_exit; | 2189 | goto erase_exit; |
| 2189 | } | 2190 | } |
| @@ -2210,8 +2211,8 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, | |||
| 2210 | 2211 | ||
| 2211 | /* See if block erase succeeded */ | 2212 | /* See if block erase succeeded */ |
| 2212 | if (status & NAND_STATUS_FAIL) { | 2213 | if (status & NAND_STATUS_FAIL) { |
| 2213 | DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: " | 2214 | DEBUG(MTD_DEBUG_LEVEL0, "%s: Failed erase, " |
| 2214 | "Failed erase, page 0x%08x\n", page); | 2215 | "page 0x%08x\n", __func__, page); |
| 2215 | instr->state = MTD_ERASE_FAILED; | 2216 | instr->state = MTD_ERASE_FAILED; |
| 2216 | instr->fail_addr = | 2217 | instr->fail_addr = |
| 2217 | ((loff_t)page << chip->page_shift); | 2218 | ((loff_t)page << chip->page_shift); |
| @@ -2271,9 +2272,9 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, | |||
| 2271 | if (!rewrite_bbt[chipnr]) | 2272 | if (!rewrite_bbt[chipnr]) |
| 2272 | continue; | 2273 | continue; |
| 2273 | /* update the BBT for chip */ | 2274 | /* update the BBT for chip */ |
| 2274 | DEBUG(MTD_DEBUG_LEVEL0, "nand_erase_nand: nand_update_bbt " | 2275 | DEBUG(MTD_DEBUG_LEVEL0, "%s: nand_update_bbt " |
| 2275 | "(%d:0x%0llx 0x%0x)\n", chipnr, rewrite_bbt[chipnr], | 2276 | "(%d:0x%0llx 0x%0x)\n", __func__, chipnr, |
| 2276 | chip->bbt_td->pages[chipnr]); | 2277 | rewrite_bbt[chipnr], chip->bbt_td->pages[chipnr]); |
| 2277 | nand_update_bbt(mtd, rewrite_bbt[chipnr]); | 2278 | nand_update_bbt(mtd, rewrite_bbt[chipnr]); |
| 2278 | } | 2279 | } |
| 2279 | 2280 | ||
| @@ -2291,7 +2292,7 @@ static void nand_sync(struct mtd_info *mtd) | |||
| 2291 | { | 2292 | { |
| 2292 | struct nand_chip *chip = mtd->priv; | 2293 | struct nand_chip *chip = mtd->priv; |
| 2293 | 2294 | ||
| 2294 | DEBUG(MTD_DEBUG_LEVEL3, "nand_sync: called\n"); | 2295 | DEBUG(MTD_DEBUG_LEVEL3, "%s: called\n", __func__); |
| 2295 | 2296 | ||
| 2296 | /* Grab the lock and see if the device is available */ | 2297 | /* Grab the lock and see if the device is available */ |
| 2297 | nand_get_device(chip, mtd, FL_SYNCING); | 2298 | nand_get_device(chip, mtd, FL_SYNCING); |
| @@ -2355,8 +2356,8 @@ static void nand_resume(struct mtd_info *mtd) | |||
| 2355 | if (chip->state == FL_PM_SUSPENDED) | 2356 | if (chip->state == FL_PM_SUSPENDED) |
| 2356 | nand_release_device(mtd); | 2357 | nand_release_device(mtd); |
| 2357 | else | 2358 | else |
| 2358 | printk(KERN_ERR "nand_resume() called for a chip which is not " | 2359 | printk(KERN_ERR "%s called for a chip which is not " |
| 2359 | "in suspended state\n"); | 2360 | "in suspended state\n", __func__); |
| 2360 | } | 2361 | } |
| 2361 | 2362 | ||
| 2362 | /* | 2363 | /* |
| @@ -2857,7 +2858,8 @@ int nand_scan(struct mtd_info *mtd, int maxchips) | |||
| 2857 | 2858 | ||
| 2858 | /* Many callers got this wrong, so check for it for a while... */ | 2859 | /* Many callers got this wrong, so check for it for a while... */ |
| 2859 | if (!mtd->owner && caller_is_module()) { | 2860 | if (!mtd->owner && caller_is_module()) { |
| 2860 | printk(KERN_CRIT "nand_scan() called with NULL mtd->owner!\n"); | 2861 | printk(KERN_CRIT "%s called with NULL mtd->owner!\n", |
| 2862 | __func__); | ||
| 2861 | BUG(); | 2863 | BUG(); |
| 2862 | } | 2864 | } |
| 2863 | 2865 | ||
