]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/mtdblock.c
[XFS] sort out opening and closing of the block devices
[linux-2.6-omap-h63xx.git] / drivers / mtd / mtdblock.c
index a052648f6e319c4f58e6d2fb6ffff7bbcaad17f6..208c6faa0358afe995608599ea7e39dc4a405e6d 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * Direct MTD block device access
  *
- * $Id: mtdblock.c,v 1.68 2005/11/07 11:14:20 gleixner Exp $
- *
  * (C) 2000-2003 Nicolas Pitre <nico@cam.org>
  * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org>
  */
@@ -278,11 +276,10 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd)
        }
 
        /* OK, it's not open. Create cache info for it */
-       mtdblk = kmalloc(sizeof(struct mtdblk_dev), GFP_KERNEL);
+       mtdblk = kzalloc(sizeof(struct mtdblk_dev), GFP_KERNEL);
        if (!mtdblk)
                return -ENOMEM;
 
-       memset(mtdblk, 0, sizeof(*mtdblk));
        mtdblk->count = 1;
        mtdblk->mtd = mtd;
 
@@ -339,13 +336,11 @@ static int mtdblock_flush(struct mtd_blktrans_dev *dev)
 
 static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
 {
-       struct mtd_blktrans_dev *dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+       struct mtd_blktrans_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 
        if (!dev)
                return;
 
-       memset(dev, 0, sizeof(*dev));
-
        dev->mtd = mtd;
        dev->devnum = mtd->index;