diff options
author | Burman Yan <yan_952@hotmail.com> | 2006-11-15 14:10:29 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-11-28 18:47:21 -0500 |
commit | 95b93a0cd46682c6d9e8eea803fda510cb6b863a (patch) | |
tree | 7e430d3fc04ed20791187d144730dd3052292c67 /drivers/mtd/nand/nandsim.c | |
parent | 998a43e72d20afa7566dad66fd866fe939a89c09 (diff) |
[MTD] replace kmalloc+memset with kzalloc
Signed-off-by: Yan Burman <yan_952@hotmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/nand/nandsim.c')
-rw-r--r-- | drivers/mtd/nand/nandsim.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index abebcab47631..3d39451ae8f5 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c | |||
@@ -1511,14 +1511,12 @@ static int __init ns_init_module(void) | |||
1511 | } | 1511 | } |
1512 | 1512 | ||
1513 | /* Allocate and initialize mtd_info, nand_chip and nandsim structures */ | 1513 | /* Allocate and initialize mtd_info, nand_chip and nandsim structures */ |
1514 | nsmtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip) | 1514 | nsmtd = kzalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip) |
1515 | + sizeof(struct nandsim), GFP_KERNEL); | 1515 | + sizeof(struct nandsim), GFP_KERNEL); |
1516 | if (!nsmtd) { | 1516 | if (!nsmtd) { |
1517 | NS_ERR("unable to allocate core structures.\n"); | 1517 | NS_ERR("unable to allocate core structures.\n"); |
1518 | return -ENOMEM; | 1518 | return -ENOMEM; |
1519 | } | 1519 | } |
1520 | memset(nsmtd, 0, sizeof(struct mtd_info) + sizeof(struct nand_chip) + | ||
1521 | sizeof(struct nandsim)); | ||
1522 | chip = (struct nand_chip *)(nsmtd + 1); | 1520 | chip = (struct nand_chip *)(nsmtd + 1); |
1523 | nsmtd->priv = (void *)chip; | 1521 | nsmtd->priv = (void *)chip; |
1524 | nand = (struct nandsim *)(chip + 1); | 1522 | nand = (struct nandsim *)(chip + 1); |