Commit bea7fe03 authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by David Woodhouse

mtd: doc: do not initialize mtd_info fields to 0 or NULL

The 'struct mtd_info' object is allocated with 'kzalloc()', so it
contains only zeroes - no need to initialize various fields to 0 or
NULL.
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 122f81d7
...@@ -562,23 +562,14 @@ void DoC2k_init(struct mtd_info *mtd) ...@@ -562,23 +562,14 @@ void DoC2k_init(struct mtd_info *mtd)
mtd->type = MTD_NANDFLASH; mtd->type = MTD_NANDFLASH;
mtd->flags = MTD_CAP_NANDFLASH; mtd->flags = MTD_CAP_NANDFLASH;
mtd->size = 0;
mtd->erasesize = 0;
mtd->writesize = 512; mtd->writesize = 512;
mtd->oobsize = 16; mtd->oobsize = 16;
mtd->owner = THIS_MODULE; mtd->owner = THIS_MODULE;
mtd->erase = doc_erase; mtd->erase = doc_erase;
mtd->point = NULL;
mtd->unpoint = NULL;
mtd->read = doc_read; mtd->read = doc_read;
mtd->write = doc_write; mtd->write = doc_write;
mtd->read_oob = doc_read_oob; mtd->read_oob = doc_read_oob;
mtd->write_oob = doc_write_oob; mtd->write_oob = doc_write_oob;
mtd->sync = NULL;
this->totlen = 0;
this->numchips = 0;
this->curfloor = -1; this->curfloor = -1;
this->curchip = -1; this->curchip = -1;
mutex_init(&this->lock); mutex_init(&this->lock);
......
...@@ -343,25 +343,17 @@ void DoCMil_init(struct mtd_info *mtd) ...@@ -343,25 +343,17 @@ void DoCMil_init(struct mtd_info *mtd)
mtd->type = MTD_NANDFLASH; mtd->type = MTD_NANDFLASH;
mtd->flags = MTD_CAP_NANDFLASH; mtd->flags = MTD_CAP_NANDFLASH;
mtd->size = 0;
/* FIXME: erase size is not always 8KiB */ /* FIXME: erase size is not always 8KiB */
mtd->erasesize = 0x2000; mtd->erasesize = 0x2000;
mtd->writesize = 512; mtd->writesize = 512;
mtd->oobsize = 16; mtd->oobsize = 16;
mtd->owner = THIS_MODULE; mtd->owner = THIS_MODULE;
mtd->erase = doc_erase; mtd->erase = doc_erase;
mtd->point = NULL;
mtd->unpoint = NULL;
mtd->read = doc_read; mtd->read = doc_read;
mtd->write = doc_write; mtd->write = doc_write;
mtd->read_oob = doc_read_oob; mtd->read_oob = doc_read_oob;
mtd->write_oob = doc_write_oob; mtd->write_oob = doc_write_oob;
mtd->sync = NULL;
this->totlen = 0;
this->numchips = 0;
this->curfloor = -1; this->curfloor = -1;
this->curchip = -1; this->curchip = -1;
......
...@@ -467,23 +467,14 @@ void DoCMilPlus_init(struct mtd_info *mtd) ...@@ -467,23 +467,14 @@ void DoCMilPlus_init(struct mtd_info *mtd)
mtd->type = MTD_NANDFLASH; mtd->type = MTD_NANDFLASH;
mtd->flags = MTD_CAP_NANDFLASH; mtd->flags = MTD_CAP_NANDFLASH;
mtd->size = 0;
mtd->erasesize = 0;
mtd->writesize = 512; mtd->writesize = 512;
mtd->oobsize = 16; mtd->oobsize = 16;
mtd->owner = THIS_MODULE; mtd->owner = THIS_MODULE;
mtd->erase = doc_erase; mtd->erase = doc_erase;
mtd->point = NULL;
mtd->unpoint = NULL;
mtd->read = doc_read; mtd->read = doc_read;
mtd->write = doc_write; mtd->write = doc_write;
mtd->read_oob = doc_read_oob; mtd->read_oob = doc_read_oob;
mtd->write_oob = doc_write_oob; mtd->write_oob = doc_write_oob;
mtd->sync = NULL;
this->totlen = 0;
this->numchips = 0;
this->curfloor = -1; this->curfloor = -1;
this->curchip = -1; this->curchip = -1;
......
...@@ -1821,13 +1821,10 @@ static void __init doc_set_driver_info(int chip_id, struct mtd_info *mtd) ...@@ -1821,13 +1821,10 @@ static void __init doc_set_driver_info(int chip_id, struct mtd_info *mtd)
mtd->oobsize = DOC_LAYOUT_OOB_SIZE; mtd->oobsize = DOC_LAYOUT_OOB_SIZE;
mtd->owner = THIS_MODULE; mtd->owner = THIS_MODULE;
mtd->erase = doc_erase; mtd->erase = doc_erase;
mtd->point = NULL;
mtd->unpoint = NULL;
mtd->read = doc_read; mtd->read = doc_read;
mtd->write = doc_write; mtd->write = doc_write;
mtd->read_oob = doc_read_oob; mtd->read_oob = doc_read_oob;
mtd->write_oob = doc_write_oob; mtd->write_oob = doc_write_oob;
mtd->sync = NULL;
mtd->block_isbad = doc_block_isbad; mtd->block_isbad = doc_block_isbad;
mtd->ecclayout = &docg3_oobinfo; mtd->ecclayout = &docg3_oobinfo;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment