Documentation/DocBook/mtdnand.tmpl: kmalloc + memset conversion to kzalloc
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
committed by
David Woodhouse
parent
d67d1d7fc3
commit
40562f812b
@@ -275,16 +275,13 @@ int __init board_init (void)
|
|||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
/* Allocate memory for MTD device structure and private data */
|
/* Allocate memory for MTD device structure and private data */
|
||||||
board_mtd = kmalloc (sizeof(struct mtd_info) + sizeof (struct nand_chip), GFP_KERNEL);
|
board_mtd = kzalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL);
|
||||||
if (!board_mtd) {
|
if (!board_mtd) {
|
||||||
printk ("Unable to allocate NAND MTD device structure.\n");
|
printk ("Unable to allocate NAND MTD device structure.\n");
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize structures */
|
|
||||||
memset ((char *) board_mtd, 0, sizeof(struct mtd_info) + sizeof(struct nand_chip));
|
|
||||||
|
|
||||||
/* map physical adress */
|
/* map physical adress */
|
||||||
baseaddr = (unsigned long)ioremap(CHIP_PHYSICAL_ADDRESS, 1024);
|
baseaddr = (unsigned long)ioremap(CHIP_PHYSICAL_ADDRESS, 1024);
|
||||||
if(!baseaddr){
|
if(!baseaddr){
|
||||||
|
Reference in New Issue
Block a user