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/mtdblock.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/mtdblock.c')
-rw-r--r-- | drivers/mtd/mtdblock.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c index a052648f6e31..952da30b1745 100644 --- a/drivers/mtd/mtdblock.c +++ b/drivers/mtd/mtdblock.c | |||
@@ -278,11 +278,10 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd) | |||
278 | } | 278 | } |
279 | 279 | ||
280 | /* OK, it's not open. Create cache info for it */ | 280 | /* OK, it's not open. Create cache info for it */ |
281 | mtdblk = kmalloc(sizeof(struct mtdblk_dev), GFP_KERNEL); | 281 | mtdblk = kzalloc(sizeof(struct mtdblk_dev), GFP_KERNEL); |
282 | if (!mtdblk) | 282 | if (!mtdblk) |
283 | return -ENOMEM; | 283 | return -ENOMEM; |
284 | 284 | ||
285 | memset(mtdblk, 0, sizeof(*mtdblk)); | ||
286 | mtdblk->count = 1; | 285 | mtdblk->count = 1; |
287 | mtdblk->mtd = mtd; | 286 | mtdblk->mtd = mtd; |
288 | 287 | ||
@@ -339,13 +338,11 @@ static int mtdblock_flush(struct mtd_blktrans_dev *dev) | |||
339 | 338 | ||
340 | static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | 339 | static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) |
341 | { | 340 | { |
342 | struct mtd_blktrans_dev *dev = kmalloc(sizeof(*dev), GFP_KERNEL); | 341 | struct mtd_blktrans_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
343 | 342 | ||
344 | if (!dev) | 343 | if (!dev) |
345 | return; | 344 | return; |
346 | 345 | ||
347 | memset(dev, 0, sizeof(*dev)); | ||
348 | |||
349 | dev->mtd = mtd; | 346 | dev->mtd = mtd; |
350 | dev->devnum = mtd->index; | 347 | dev->devnum = mtd->index; |
351 | 348 | ||