mtd: add leading underscore to all mtd functions
This patch renames all MTD functions by adding a "_" prefix: mtd->erase -> mtd->_erase mtd->read_oob -> mtd->_read_oob ... The reason is that we are re-working the MTD API and from now on it is an error to use MTD function pointers directly - we have a corresponding API call for every pointer. By adding a leading "_" we achieve the following: 1. Make sure we convert every direct pointer users 2. A leading "_" suggests that this interface is internal and it becomes less likely that people will use them directly 3. Make sure all the out-of-tree modules stop compiling and the owners spot the big API change and amend them. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:

committad av
David Woodhouse

förälder
a6c22850d2
incheckning
3c3c10bba1
@@ -262,9 +262,9 @@ static void fixup_st_m28w320cb(struct mtd_info *mtd)
|
||||
static void fixup_use_point(struct mtd_info *mtd)
|
||||
{
|
||||
struct map_info *map = mtd->priv;
|
||||
if (!mtd->point && map_is_linear(map)) {
|
||||
mtd->point = cfi_intelext_point;
|
||||
mtd->unpoint = cfi_intelext_unpoint;
|
||||
if (!mtd->_point && map_is_linear(map)) {
|
||||
mtd->_point = cfi_intelext_point;
|
||||
mtd->_unpoint = cfi_intelext_unpoint;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,8 +274,8 @@ static void fixup_use_write_buffers(struct mtd_info *mtd)
|
||||
struct cfi_private *cfi = map->fldrv_priv;
|
||||
if (cfi->cfiq->BufWriteTimeoutTyp) {
|
||||
printk(KERN_INFO "Using buffer write method\n" );
|
||||
mtd->write = cfi_intelext_write_buffers;
|
||||
mtd->writev = cfi_intelext_writev;
|
||||
mtd->_write = cfi_intelext_write_buffers;
|
||||
mtd->_writev = cfi_intelext_writev;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,15 +443,15 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
|
||||
mtd->type = MTD_NORFLASH;
|
||||
|
||||
/* Fill in the default mtd operations */
|
||||
mtd->erase = cfi_intelext_erase_varsize;
|
||||
mtd->read = cfi_intelext_read;
|
||||
mtd->write = cfi_intelext_write_words;
|
||||
mtd->sync = cfi_intelext_sync;
|
||||
mtd->lock = cfi_intelext_lock;
|
||||
mtd->unlock = cfi_intelext_unlock;
|
||||
mtd->is_locked = cfi_intelext_is_locked;
|
||||
mtd->suspend = cfi_intelext_suspend;
|
||||
mtd->resume = cfi_intelext_resume;
|
||||
mtd->_erase = cfi_intelext_erase_varsize;
|
||||
mtd->_read = cfi_intelext_read;
|
||||
mtd->_write = cfi_intelext_write_words;
|
||||
mtd->_sync = cfi_intelext_sync;
|
||||
mtd->_lock = cfi_intelext_lock;
|
||||
mtd->_unlock = cfi_intelext_unlock;
|
||||
mtd->_is_locked = cfi_intelext_is_locked;
|
||||
mtd->_suspend = cfi_intelext_suspend;
|
||||
mtd->_resume = cfi_intelext_resume;
|
||||
mtd->flags = MTD_CAP_NORFLASH;
|
||||
mtd->name = map->name;
|
||||
mtd->writesize = 1;
|
||||
@@ -600,12 +600,12 @@ static struct mtd_info *cfi_intelext_setup(struct mtd_info *mtd)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MTD_OTP
|
||||
mtd->read_fact_prot_reg = cfi_intelext_read_fact_prot_reg;
|
||||
mtd->read_user_prot_reg = cfi_intelext_read_user_prot_reg;
|
||||
mtd->write_user_prot_reg = cfi_intelext_write_user_prot_reg;
|
||||
mtd->lock_user_prot_reg = cfi_intelext_lock_user_prot_reg;
|
||||
mtd->get_fact_prot_info = cfi_intelext_get_fact_prot_info;
|
||||
mtd->get_user_prot_info = cfi_intelext_get_user_prot_info;
|
||||
mtd->_read_fact_prot_reg = cfi_intelext_read_fact_prot_reg;
|
||||
mtd->_read_user_prot_reg = cfi_intelext_read_user_prot_reg;
|
||||
mtd->_write_user_prot_reg = cfi_intelext_write_user_prot_reg;
|
||||
mtd->_lock_user_prot_reg = cfi_intelext_lock_user_prot_reg;
|
||||
mtd->_get_fact_prot_info = cfi_intelext_get_fact_prot_info;
|
||||
mtd->_get_user_prot_info = cfi_intelext_get_user_prot_info;
|
||||
#endif
|
||||
|
||||
/* This function has the potential to distort the reality
|
||||
|
@@ -192,7 +192,7 @@ static void fixup_use_write_buffers(struct mtd_info *mtd)
|
||||
struct cfi_private *cfi = map->fldrv_priv;
|
||||
if (cfi->cfiq->BufWriteTimeoutTyp) {
|
||||
pr_debug("Using buffer write method\n" );
|
||||
mtd->write = cfi_amdstd_write_buffers;
|
||||
mtd->_write = cfi_amdstd_write_buffers;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,8 +231,8 @@ static void fixup_convert_atmel_pri(struct mtd_info *mtd)
|
||||
static void fixup_use_secsi(struct mtd_info *mtd)
|
||||
{
|
||||
/* Setup for chips with a secsi area */
|
||||
mtd->read_user_prot_reg = cfi_amdstd_secsi_read;
|
||||
mtd->read_fact_prot_reg = cfi_amdstd_secsi_read;
|
||||
mtd->_read_user_prot_reg = cfi_amdstd_secsi_read;
|
||||
mtd->_read_fact_prot_reg = cfi_amdstd_secsi_read;
|
||||
}
|
||||
|
||||
static void fixup_use_erase_chip(struct mtd_info *mtd)
|
||||
@@ -241,7 +241,7 @@ static void fixup_use_erase_chip(struct mtd_info *mtd)
|
||||
struct cfi_private *cfi = map->fldrv_priv;
|
||||
if ((cfi->cfiq->NumEraseRegions == 1) &&
|
||||
((cfi->cfiq->EraseRegionInfo[0] & 0xffff) == 0)) {
|
||||
mtd->erase = cfi_amdstd_erase_chip;
|
||||
mtd->_erase = cfi_amdstd_erase_chip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -252,8 +252,8 @@ static void fixup_use_erase_chip(struct mtd_info *mtd)
|
||||
*/
|
||||
static void fixup_use_atmel_lock(struct mtd_info *mtd)
|
||||
{
|
||||
mtd->lock = cfi_atmel_lock;
|
||||
mtd->unlock = cfi_atmel_unlock;
|
||||
mtd->_lock = cfi_atmel_lock;
|
||||
mtd->_unlock = cfi_atmel_unlock;
|
||||
mtd->flags |= MTD_POWERUP_LOCK;
|
||||
}
|
||||
|
||||
@@ -432,12 +432,12 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
|
||||
mtd->type = MTD_NORFLASH;
|
||||
|
||||
/* Fill in the default mtd operations */
|
||||
mtd->erase = cfi_amdstd_erase_varsize;
|
||||
mtd->write = cfi_amdstd_write_words;
|
||||
mtd->read = cfi_amdstd_read;
|
||||
mtd->sync = cfi_amdstd_sync;
|
||||
mtd->suspend = cfi_amdstd_suspend;
|
||||
mtd->resume = cfi_amdstd_resume;
|
||||
mtd->_erase = cfi_amdstd_erase_varsize;
|
||||
mtd->_write = cfi_amdstd_write_words;
|
||||
mtd->_read = cfi_amdstd_read;
|
||||
mtd->_sync = cfi_amdstd_sync;
|
||||
mtd->_suspend = cfi_amdstd_suspend;
|
||||
mtd->_resume = cfi_amdstd_resume;
|
||||
mtd->flags = MTD_CAP_NORFLASH;
|
||||
mtd->name = map->name;
|
||||
mtd->writesize = 1;
|
||||
@@ -446,7 +446,7 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
|
||||
pr_debug("MTD %s(): write buffer size %d\n", __func__,
|
||||
mtd->writebufsize);
|
||||
|
||||
mtd->panic_write = cfi_amdstd_panic_write;
|
||||
mtd->_panic_write = cfi_amdstd_panic_write;
|
||||
mtd->reboot_notifier.notifier_call = cfi_amdstd_reboot;
|
||||
|
||||
if (cfi->cfi_mode==CFI_MODE_CFI){
|
||||
|
@@ -228,15 +228,15 @@ static struct mtd_info *cfi_staa_setup(struct map_info *map)
|
||||
}
|
||||
|
||||
/* Also select the correct geometry setup too */
|
||||
mtd->erase = cfi_staa_erase_varsize;
|
||||
mtd->read = cfi_staa_read;
|
||||
mtd->write = cfi_staa_write_buffers;
|
||||
mtd->writev = cfi_staa_writev;
|
||||
mtd->sync = cfi_staa_sync;
|
||||
mtd->lock = cfi_staa_lock;
|
||||
mtd->unlock = cfi_staa_unlock;
|
||||
mtd->suspend = cfi_staa_suspend;
|
||||
mtd->resume = cfi_staa_resume;
|
||||
mtd->_erase = cfi_staa_erase_varsize;
|
||||
mtd->_read = cfi_staa_read;
|
||||
mtd->_write = cfi_staa_write_buffers;
|
||||
mtd->_writev = cfi_staa_writev;
|
||||
mtd->_sync = cfi_staa_sync;
|
||||
mtd->_lock = cfi_staa_lock;
|
||||
mtd->_unlock = cfi_staa_unlock;
|
||||
mtd->_suspend = cfi_staa_suspend;
|
||||
mtd->_resume = cfi_staa_resume;
|
||||
mtd->flags = MTD_CAP_NORFLASH & ~MTD_BIT_WRITEABLE;
|
||||
mtd->writesize = 8; /* FIXME: Should be 0 for STMicro flashes w/out ECC */
|
||||
mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
|
||||
|
@@ -101,7 +101,7 @@ static void fixup_use_fwh_lock(struct mtd_info *mtd)
|
||||
{
|
||||
printk(KERN_NOTICE "using fwh lock/unlock method\n");
|
||||
/* Setup for the chips with the fwh lock method */
|
||||
mtd->lock = fwh_lock_varsize;
|
||||
mtd->unlock = fwh_unlock_varsize;
|
||||
mtd->_lock = fwh_lock_varsize;
|
||||
mtd->_unlock = fwh_unlock_varsize;
|
||||
}
|
||||
#endif /* FWH_LOCK_H */
|
||||
|
@@ -55,10 +55,10 @@ static struct mtd_info *map_absent_probe(struct map_info *map)
|
||||
mtd->name = map->name;
|
||||
mtd->type = MTD_ABSENT;
|
||||
mtd->size = map->size;
|
||||
mtd->erase = map_absent_erase;
|
||||
mtd->read = map_absent_read;
|
||||
mtd->write = map_absent_write;
|
||||
mtd->sync = map_absent_sync;
|
||||
mtd->_erase = map_absent_erase;
|
||||
mtd->_read = map_absent_read;
|
||||
mtd->_write = map_absent_write;
|
||||
mtd->_sync = map_absent_sync;
|
||||
mtd->flags = 0;
|
||||
mtd->erasesize = PAGE_SIZE;
|
||||
mtd->writesize = 1;
|
||||
|
@@ -64,11 +64,11 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
|
||||
mtd->name = map->name;
|
||||
mtd->type = MTD_RAM;
|
||||
mtd->size = map->size;
|
||||
mtd->erase = mapram_erase;
|
||||
mtd->get_unmapped_area = mapram_unmapped_area;
|
||||
mtd->read = mapram_read;
|
||||
mtd->write = mapram_write;
|
||||
mtd->sync = mapram_nop;
|
||||
mtd->_erase = mapram_erase;
|
||||
mtd->_get_unmapped_area = mapram_unmapped_area;
|
||||
mtd->_read = mapram_read;
|
||||
mtd->_write = mapram_write;
|
||||
mtd->_sync = mapram_nop;
|
||||
mtd->flags = MTD_CAP_RAM;
|
||||
mtd->writesize = 1;
|
||||
|
||||
|
@@ -41,11 +41,11 @@ static struct mtd_info *map_rom_probe(struct map_info *map)
|
||||
mtd->name = map->name;
|
||||
mtd->type = MTD_ROM;
|
||||
mtd->size = map->size;
|
||||
mtd->get_unmapped_area = maprom_unmapped_area;
|
||||
mtd->read = maprom_read;
|
||||
mtd->write = maprom_write;
|
||||
mtd->sync = maprom_nop;
|
||||
mtd->erase = maprom_erase;
|
||||
mtd->_get_unmapped_area = maprom_unmapped_area;
|
||||
mtd->_read = maprom_read;
|
||||
mtd->_write = maprom_write;
|
||||
mtd->_sync = maprom_nop;
|
||||
mtd->_erase = maprom_erase;
|
||||
mtd->flags = MTD_CAP_ROM;
|
||||
mtd->erasesize = map->size;
|
||||
mtd->writesize = 1;
|
||||
|
Referens i nytt ärende
Block a user