aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-05-12 23:03:42 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-12 23:03:42 -0400
commitc3f8abf481c2d2b221b028f7369bc6dd39a9590e (patch)
tree58a8fbb73f736da8b4d0529e0e182ec41f30b6d5 /drivers/mtd
parent4992a9e88886b0c5ebc3d27eb74d0344c873eeea (diff)
[MTD NAND] Use vmalloc for buffer when scanning for bad blocks.
These new chips have 128KiB blocks. Don't try to kmalloc that. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/nand_bbt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index ca286999fe08..32f063b6e9a5 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -60,7 +60,7 @@
60#include <linux/mtd/compatmac.h> 60#include <linux/mtd/compatmac.h>
61#include <linux/bitops.h> 61#include <linux/bitops.h>
62#include <linux/delay.h> 62#include <linux/delay.h>
63 63#include <linux/vmalloc.h>
64 64
65/** 65/**
66 * check_pattern - [GENERIC] check if a pattern is in the buffer 66 * check_pattern - [GENERIC] check if a pattern is in the buffer
@@ -873,7 +873,7 @@ int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd)
873 /* Allocate a temporary buffer for one eraseblock incl. oob */ 873 /* Allocate a temporary buffer for one eraseblock incl. oob */
874 len = (1 << this->bbt_erase_shift); 874 len = (1 << this->bbt_erase_shift);
875 len += (len >> this->page_shift) * mtd->oobsize; 875 len += (len >> this->page_shift) * mtd->oobsize;
876 buf = kmalloc (len, GFP_KERNEL); 876 buf = vmalloc(len);
877 if (!buf) { 877 if (!buf) {
878 printk (KERN_ERR "nand_bbt: Out of memory\n"); 878 printk (KERN_ERR "nand_bbt: Out of memory\n");
879 kfree (this->bbt); 879 kfree (this->bbt);
@@ -897,7 +897,7 @@ int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd)
897 if (md) 897 if (md)
898 mark_bbt_region (mtd, md); 898 mark_bbt_region (mtd, md);
899 899
900 kfree (buf); 900 vfree (buf);
901 return res; 901 return res;
902} 902}
903 903