Skip to content

Commit 17ffc7b

Browse files
author
Artem B. Bityutskiy
committed
[MTD] Initialize 'writesize'
Signed-off-by: Artem B. Bityutskiy <dedekind@infradead.org>
1 parent 1794c13 commit 17ffc7b

11 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎drivers/mtd/chips/cfi_cmdset_0001.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
357357
mtd->resume = cfi_intelext_resume;
358358
mtd->flags = MTD_CAP_NORFLASH;
359359
mtd->name = map->name;
360+
mtd->writesize = 1;
360361

361362
mtd->reboot_notifier.notifier_call = cfi_intelext_reboot;
362363

‎drivers/mtd/chips/jedec.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
256256
MTD->name = map->name;
257257
MTD->type = MTD_NORFLASH;
258258
MTD->flags = MTD_CAP_NORFLASH;
259+
MTD->writesize = 1;
259260
MTD->erasesize = SectorSize*(map->buswidth);
260261
// printk("MTD->erasesize is %x\n",(unsigned int)MTD->erasesize);
261262
MTD->size = priv->size;

‎drivers/mtd/chips/map_absent.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ static struct mtd_info *map_absent_probe(struct map_info *map)
6464
mtd->write = map_absent_write;
6565
mtd->sync = map_absent_sync;
6666
mtd->flags = 0;
67-
mtd->erasesize = PAGE_SIZE;
67+
mtd->erasesize = PAGE_SIZE;
68+
mtd->writesize = 1;
6869

6970
__module_get(THIS_MODULE);
7071
return mtd;

‎drivers/mtd/chips/map_ram.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
7171
mtd->write = mapram_write;
7272
mtd->sync = mapram_nop;
7373
mtd->flags = MTD_CAP_RAM;
74+
mtd->writesize = 1;
7475

7576
mtd->erasesize = PAGE_SIZE;
7677
while(mtd->size & (mtd->erasesize - 1))

‎drivers/mtd/chips/map_rom.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static struct mtd_info *map_rom_probe(struct map_info *map)
4747
mtd->sync = maprom_nop;
4848
mtd->flags = MTD_CAP_ROM;
4949
mtd->erasesize = map->size;
50+
mtd->writesize = 1;
5051

5152
__module_get(THIS_MODULE);
5253
return mtd;

‎drivers/mtd/devices/block2mtd.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size)
324324

325325
dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
326326
dev->mtd.erasesize = erase_size;
327+
dev->mtd.writesize = 1;
327328
dev->mtd.type = MTD_RAM;
328329
dev->mtd.flags = MTD_CAP_RAM;
329330
dev->mtd.erase = block2mtd_erase;

‎drivers/mtd/devices/ms02-nv.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ static int __init ms02nv_init_one(ulong addr)
225225
mtd->owner = THIS_MODULE;
226226
mtd->read = ms02nv_read;
227227
mtd->write = ms02nv_write;
228+
mtd->writesize = 1;
228229

229230
ret = -EIO;
230231
if (add_mtd_device(mtd)) {

‎drivers/mtd/devices/mtd_dataflash.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ add_dataflash(struct spi_device *spi, char *name,
478478
device->name = (pdata && pdata->name) ? pdata->name : priv->name;
479479
device->size = nr_pages * pagesize;
480480
device->erasesize = pagesize;
481+
device->writesize = pagesize;
481482
device->owner = THIS_MODULE;
482483
device->type = MTD_DATAFLASH;
483484
device->flags = MTD_CAP_NORFLASH;

‎drivers/mtd/devices/phram.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ static int register_device(char *name, unsigned long start, unsigned long len)
151151
new->mtd.owner = THIS_MODULE;
152152
new->mtd.type = MTD_RAM;
153153
new->mtd.erasesize = PAGE_SIZE;
154+
new->mtd.writesize = 1;
154155

155156
ret = -EAGAIN;
156157
if (add_mtd_device(&new->mtd)) {

‎drivers/mtd/devices/pmc551.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,8 @@ static int __init init_pmc551(void)
778778
mtd->type = MTD_RAM;
779779
mtd->name = "PMC551 RAM board";
780780
mtd->erasesize = 0x10000;
781-
mtd->owner = THIS_MODULE;
781+
mtd->writesize = 1;
782+
mtd->owner = THIS_MODULE;
782783

783784
if (add_mtd_device(mtd)) {
784785
printk(KERN_NOTICE "pmc551: Failed to register new device\n");

0 commit comments

Comments
 (0)