aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/DocBook')
-rw-r--r--Documentation/DocBook/mtdnand.tmpl5
1 files changed, 1 insertions, 4 deletions
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl
index a8c8cce50633..6fbc41d98c1e 100644
--- a/Documentation/DocBook/mtdnand.tmpl
+++ b/Documentation/DocBook/mtdnand.tmpl
@@ -275,16 +275,13 @@ int __init board_init (void)
275 int err = 0; 275 int err = 0;
276 276
277 /* Allocate memory for MTD device structure and private data */ 277 /* Allocate memory for MTD device structure and private data */
278 board_mtd = kmalloc (sizeof(struct mtd_info) + sizeof (struct nand_chip), GFP_KERNEL); 278 board_mtd = kzalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL);
279 if (!board_mtd) { 279 if (!board_mtd) {
280 printk ("Unable to allocate NAND MTD device structure.\n"); 280 printk ("Unable to allocate NAND MTD device structure.\n");
281 err = -ENOMEM; 281 err = -ENOMEM;
282 goto out; 282 goto out;
283 } 283 }
284 284
285 /* Initialize structures */
286 memset ((char *) board_mtd, 0, sizeof(struct mtd_info) + sizeof(struct nand_chip));
287
288 /* map physical adress */ 285 /* map physical adress */
289 baseaddr = (unsigned long)ioremap(CHIP_PHYSICAL_ADDRESS, 1024); 286 baseaddr = (unsigned long)ioremap(CHIP_PHYSICAL_ADDRESS, 1024);
290 if(!baseaddr){ 287 if(!baseaddr){