diff options
| -rw-r--r-- | drivers/mtd/chips/amd_flash.c | 1 | ||||
| -rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 1 | ||||
| -rw-r--r-- | drivers/mtd/chips/sharp.c | 1 | ||||
| -rw-r--r-- | drivers/mtd/devices/lart.c | 1 | ||||
| -rw-r--r-- | drivers/mtd/devices/m25p80.c | 1 | ||||
| -rw-r--r-- | drivers/mtd/devices/mtdram.c | 1 | ||||
| -rw-r--r-- | drivers/mtd/mtdcore.c | 1 | ||||
| -rw-r--r-- | include/linux/mtd/mtd.h | 9 |
8 files changed, 13 insertions, 3 deletions
diff --git a/drivers/mtd/chips/amd_flash.c b/drivers/mtd/chips/amd_flash.c index 9e466509a23d..16eaca69fb5a 100644 --- a/drivers/mtd/chips/amd_flash.c +++ b/drivers/mtd/chips/amd_flash.c | |||
| @@ -730,6 +730,7 @@ static struct mtd_info *amd_flash_probe(struct map_info *map) | |||
| 730 | offset += dev_size; | 730 | offset += dev_size; |
| 731 | } | 731 | } |
| 732 | mtd->type = MTD_NORFLASH; | 732 | mtd->type = MTD_NORFLASH; |
| 733 | mtd->writesize = 1; | ||
| 733 | mtd->flags = MTD_CAP_NORFLASH; | 734 | mtd->flags = MTD_CAP_NORFLASH; |
| 734 | mtd->name = map->name; | 735 | mtd->name = map->name; |
| 735 | mtd->erase = amd_flash_erase; | 736 | mtd->erase = amd_flash_erase; |
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 3aeb0c79e714..1e01ad38b26e 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
| @@ -236,6 +236,7 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) | |||
| 236 | mtd->resume = cfi_amdstd_resume; | 236 | mtd->resume = cfi_amdstd_resume; |
| 237 | mtd->flags = MTD_CAP_NORFLASH; | 237 | mtd->flags = MTD_CAP_NORFLASH; |
| 238 | mtd->name = map->name; | 238 | mtd->name = map->name; |
| 239 | mtd->writesize = 1; | ||
| 239 | 240 | ||
| 240 | if (cfi->cfi_mode==CFI_MODE_CFI){ | 241 | if (cfi->cfi_mode==CFI_MODE_CFI){ |
| 241 | unsigned char bootloc; | 242 | unsigned char bootloc; |
diff --git a/drivers/mtd/chips/sharp.c b/drivers/mtd/chips/sharp.c index 3cc0b23c5865..967abbecdff9 100644 --- a/drivers/mtd/chips/sharp.c +++ b/drivers/mtd/chips/sharp.c | |||
| @@ -140,6 +140,7 @@ static struct mtd_info *sharp_probe(struct map_info *map) | |||
| 140 | mtd->suspend = sharp_suspend; | 140 | mtd->suspend = sharp_suspend; |
| 141 | mtd->resume = sharp_resume; | 141 | mtd->resume = sharp_resume; |
| 142 | mtd->flags = MTD_CAP_NORFLASH; | 142 | mtd->flags = MTD_CAP_NORFLASH; |
| 143 | mtd->writesize = 1; | ||
| 143 | mtd->name = map->name; | 144 | mtd->name = map->name; |
| 144 | 145 | ||
| 145 | memset(sharp, 0, sizeof(*sharp)); | 146 | memset(sharp, 0, sizeof(*sharp)); |
diff --git a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c index 29b0ddaa324e..4ea50a1dda85 100644 --- a/drivers/mtd/devices/lart.c +++ b/drivers/mtd/devices/lart.c | |||
| @@ -635,6 +635,7 @@ int __init lart_flash_init (void) | |||
| 635 | printk ("%s: This looks like a LART board to me.\n",module_name); | 635 | printk ("%s: This looks like a LART board to me.\n",module_name); |
| 636 | mtd.name = module_name; | 636 | mtd.name = module_name; |
| 637 | mtd.type = MTD_NORFLASH; | 637 | mtd.type = MTD_NORFLASH; |
| 638 | mtd.writesize = 1; | ||
| 638 | mtd.flags = MTD_CAP_NORFLASH; | 639 | mtd.flags = MTD_CAP_NORFLASH; |
| 639 | mtd.size = FLASH_BLOCKSIZE_PARAM * FLASH_NUMBLOCKS_16m_PARAM + FLASH_BLOCKSIZE_MAIN * FLASH_NUMBLOCKS_16m_MAIN; | 640 | mtd.size = FLASH_BLOCKSIZE_PARAM * FLASH_NUMBLOCKS_16m_PARAM + FLASH_BLOCKSIZE_MAIN * FLASH_NUMBLOCKS_16m_MAIN; |
| 640 | mtd.erasesize = FLASH_BLOCKSIZE_MAIN; | 641 | mtd.erasesize = FLASH_BLOCKSIZE_MAIN; |
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 04e65d5dae00..a8466141e914 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c | |||
| @@ -465,6 +465,7 @@ static int __devinit m25p_probe(struct spi_device *spi) | |||
| 465 | flash->mtd.name = spi->dev.bus_id; | 465 | flash->mtd.name = spi->dev.bus_id; |
| 466 | 466 | ||
| 467 | flash->mtd.type = MTD_NORFLASH; | 467 | flash->mtd.type = MTD_NORFLASH; |
| 468 | flash->mtd.writesize = 1; | ||
| 468 | flash->mtd.flags = MTD_CAP_NORFLASH; | 469 | flash->mtd.flags = MTD_CAP_NORFLASH; |
| 469 | flash->mtd.size = info->sector_size * info->n_sectors; | 470 | flash->mtd.size = info->sector_size * info->n_sectors; |
| 470 | flash->mtd.erasesize = info->sector_size; | 471 | flash->mtd.erasesize = info->sector_size; |
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c index f284c9670be8..8ab4b931215f 100644 --- a/drivers/mtd/devices/mtdram.c +++ b/drivers/mtd/devices/mtdram.c | |||
| @@ -106,6 +106,7 @@ int mtdram_init_device(struct mtd_info *mtd, void *mapped_address, | |||
| 106 | mtd->type = MTD_GENERIC_TYPE; | 106 | mtd->type = MTD_GENERIC_TYPE; |
| 107 | mtd->flags = MTD_CAP_RAM; | 107 | mtd->flags = MTD_CAP_RAM; |
| 108 | mtd->size = size; | 108 | mtd->size = size; |
| 109 | mtd->writesize = 1; | ||
| 109 | mtd->erasesize = MTDRAM_ERASE_SIZE; | 110 | mtd->erasesize = MTDRAM_ERASE_SIZE; |
| 110 | mtd->priv = mapped_address; | 111 | mtd->priv = mapped_address; |
| 111 | 112 | ||
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 49bc9fdcb88b..16a952dd486a 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c | |||
| @@ -47,6 +47,7 @@ int add_mtd_device(struct mtd_info *mtd) | |||
| 47 | { | 47 | { |
| 48 | int i; | 48 | int i; |
| 49 | 49 | ||
| 50 | BUG_ON(mtd->writesize == 0); | ||
| 50 | mutex_lock(&mtd_table_mutex); | 51 | mutex_lock(&mtd_table_mutex); |
| 51 | 52 | ||
| 52 | for (i=0; i < MAX_MTD_DEVICES; i++) | 53 | for (i=0; i < MAX_MTD_DEVICES; i++) |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 9536567d041b..e1d2a3d56546 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -110,9 +110,12 @@ struct mtd_info { | |||
| 110 | * information below if they desire | 110 | * information below if they desire |
| 111 | */ | 111 | */ |
| 112 | u_int32_t erasesize; | 112 | u_int32_t erasesize; |
| 113 | /* Smallest availlable size for writing to the device. For NAND, | 113 | /* Minimal writable flash unit size. In case of NOR flash it is 1 (even |
| 114 | * this is the page size, for some NOR chips, the size of ECC | 114 | * though individual bits can be cleared), in case of NAND flash it is |
| 115 | * covered blocks. | 115 | * one NAND page (or half, or one-fourths of it), in case of ECC-ed NOR |
| 116 | * it is of ECC block size, etc. It is illegal to have writesize = 0. | ||
| 117 | * Any driver registering a struct mtd_info must ensure a writesize of | ||
| 118 | * 1 or larger. | ||
| 116 | */ | 119 | */ |
| 117 | u_int32_t writesize; | 120 | u_int32_t writesize; |
| 118 | 121 | ||
