diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-01-30 07:58:32 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-26 19:20:01 -0400 |
commit | 3c3c10bba1e4ccb75b41442e45c1a072f6cded19 (patch) | |
tree | 5c929e46cd0b6fcf8a42db7637cf45dbf69fe126 | |
parent | a6c22850d20273896e7c8ee996730ccf2ba60a22 (diff) |
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>
36 files changed, 350 insertions, 349 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index e1e122f2f929..152accf4bf85 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c | |||
@@ -262,9 +262,9 @@ static void fixup_st_m28w320cb(struct mtd_info *mtd) | |||
262 | static void fixup_use_point(struct mtd_info *mtd) | 262 | static void fixup_use_point(struct mtd_info *mtd) |
263 | { | 263 | { |
264 | struct map_info *map = mtd->priv; | 264 | struct map_info *map = mtd->priv; |
265 | if (!mtd->point && map_is_linear(map)) { | 265 | if (!mtd->_point && map_is_linear(map)) { |
266 | mtd->point = cfi_intelext_point; | 266 | mtd->_point = cfi_intelext_point; |
267 | mtd->unpoint = cfi_intelext_unpoint; | 267 | mtd->_unpoint = cfi_intelext_unpoint; |
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
@@ -274,8 +274,8 @@ static void fixup_use_write_buffers(struct mtd_info *mtd) | |||
274 | struct cfi_private *cfi = map->fldrv_priv; | 274 | struct cfi_private *cfi = map->fldrv_priv; |
275 | if (cfi->cfiq->BufWriteTimeoutTyp) { | 275 | if (cfi->cfiq->BufWriteTimeoutTyp) { |
276 | printk(KERN_INFO "Using buffer write method\n" ); | 276 | printk(KERN_INFO "Using buffer write method\n" ); |
277 | mtd->write = cfi_intelext_write_buffers; | 277 | mtd->_write = cfi_intelext_write_buffers; |
278 | mtd->writev = cfi_intelext_writev; | 278 | mtd->_writev = cfi_intelext_writev; |
279 | } | 279 | } |
280 | } | 280 | } |
281 | 281 | ||
@@ -443,15 +443,15 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary) | |||
443 | mtd->type = MTD_NORFLASH; | 443 | mtd->type = MTD_NORFLASH; |
444 | 444 | ||
445 | /* Fill in the default mtd operations */ | 445 | /* Fill in the default mtd operations */ |
446 | mtd->erase = cfi_intelext_erase_varsize; | 446 | mtd->_erase = cfi_intelext_erase_varsize; |
447 | mtd->read = cfi_intelext_read; | 447 | mtd->_read = cfi_intelext_read; |
448 | mtd->write = cfi_intelext_write_words; | 448 | mtd->_write = cfi_intelext_write_words; |
449 | mtd->sync = cfi_intelext_sync; | 449 | mtd->_sync = cfi_intelext_sync; |
450 | mtd->lock = cfi_intelext_lock; | 450 | mtd->_lock = cfi_intelext_lock; |
451 | mtd->unlock = cfi_intelext_unlock; | 451 | mtd->_unlock = cfi_intelext_unlock; |
452 | mtd->is_locked = cfi_intelext_is_locked; | 452 | mtd->_is_locked = cfi_intelext_is_locked; |
453 | mtd->suspend = cfi_intelext_suspend; | 453 | mtd->_suspend = cfi_intelext_suspend; |
454 | mtd->resume = cfi_intelext_resume; | 454 | mtd->_resume = cfi_intelext_resume; |
455 | mtd->flags = MTD_CAP_NORFLASH; | 455 | mtd->flags = MTD_CAP_NORFLASH; |
456 | mtd->name = map->name; | 456 | mtd->name = map->name; |
457 | mtd->writesize = 1; | 457 | mtd->writesize = 1; |
@@ -600,12 +600,12 @@ static struct mtd_info *cfi_intelext_setup(struct mtd_info *mtd) | |||
600 | } | 600 | } |
601 | 601 | ||
602 | #ifdef CONFIG_MTD_OTP | 602 | #ifdef CONFIG_MTD_OTP |
603 | mtd->read_fact_prot_reg = cfi_intelext_read_fact_prot_reg; | 603 | mtd->_read_fact_prot_reg = cfi_intelext_read_fact_prot_reg; |
604 | mtd->read_user_prot_reg = cfi_intelext_read_user_prot_reg; | 604 | mtd->_read_user_prot_reg = cfi_intelext_read_user_prot_reg; |
605 | mtd->write_user_prot_reg = cfi_intelext_write_user_prot_reg; | 605 | mtd->_write_user_prot_reg = cfi_intelext_write_user_prot_reg; |
606 | mtd->lock_user_prot_reg = cfi_intelext_lock_user_prot_reg; | 606 | mtd->_lock_user_prot_reg = cfi_intelext_lock_user_prot_reg; |
607 | mtd->get_fact_prot_info = cfi_intelext_get_fact_prot_info; | 607 | mtd->_get_fact_prot_info = cfi_intelext_get_fact_prot_info; |
608 | mtd->get_user_prot_info = cfi_intelext_get_user_prot_info; | 608 | mtd->_get_user_prot_info = cfi_intelext_get_user_prot_info; |
609 | #endif | 609 | #endif |
610 | 610 | ||
611 | /* This function has the potential to distort the reality | 611 | /* This function has the potential to distort the reality |
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index e2d94bb1d7c8..27ac0622abe3 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
@@ -192,7 +192,7 @@ static void fixup_use_write_buffers(struct mtd_info *mtd) | |||
192 | struct cfi_private *cfi = map->fldrv_priv; | 192 | struct cfi_private *cfi = map->fldrv_priv; |
193 | if (cfi->cfiq->BufWriteTimeoutTyp) { | 193 | if (cfi->cfiq->BufWriteTimeoutTyp) { |
194 | pr_debug("Using buffer write method\n" ); | 194 | pr_debug("Using buffer write method\n" ); |
195 | mtd->write = cfi_amdstd_write_buffers; | 195 | mtd->_write = cfi_amdstd_write_buffers; |
196 | } | 196 | } |
197 | } | 197 | } |
198 | 198 | ||
@@ -231,8 +231,8 @@ static void fixup_convert_atmel_pri(struct mtd_info *mtd) | |||
231 | static void fixup_use_secsi(struct mtd_info *mtd) | 231 | static void fixup_use_secsi(struct mtd_info *mtd) |
232 | { | 232 | { |
233 | /* Setup for chips with a secsi area */ | 233 | /* Setup for chips with a secsi area */ |
234 | mtd->read_user_prot_reg = cfi_amdstd_secsi_read; | 234 | mtd->_read_user_prot_reg = cfi_amdstd_secsi_read; |
235 | mtd->read_fact_prot_reg = cfi_amdstd_secsi_read; | 235 | mtd->_read_fact_prot_reg = cfi_amdstd_secsi_read; |
236 | } | 236 | } |
237 | 237 | ||
238 | static void fixup_use_erase_chip(struct mtd_info *mtd) | 238 | static void fixup_use_erase_chip(struct mtd_info *mtd) |
@@ -241,7 +241,7 @@ static void fixup_use_erase_chip(struct mtd_info *mtd) | |||
241 | struct cfi_private *cfi = map->fldrv_priv; | 241 | struct cfi_private *cfi = map->fldrv_priv; |
242 | if ((cfi->cfiq->NumEraseRegions == 1) && | 242 | if ((cfi->cfiq->NumEraseRegions == 1) && |
243 | ((cfi->cfiq->EraseRegionInfo[0] & 0xffff) == 0)) { | 243 | ((cfi->cfiq->EraseRegionInfo[0] & 0xffff) == 0)) { |
244 | mtd->erase = cfi_amdstd_erase_chip; | 244 | mtd->_erase = cfi_amdstd_erase_chip; |
245 | } | 245 | } |
246 | 246 | ||
247 | } | 247 | } |
@@ -252,8 +252,8 @@ static void fixup_use_erase_chip(struct mtd_info *mtd) | |||
252 | */ | 252 | */ |
253 | static void fixup_use_atmel_lock(struct mtd_info *mtd) | 253 | static void fixup_use_atmel_lock(struct mtd_info *mtd) |
254 | { | 254 | { |
255 | mtd->lock = cfi_atmel_lock; | 255 | mtd->_lock = cfi_atmel_lock; |
256 | mtd->unlock = cfi_atmel_unlock; | 256 | mtd->_unlock = cfi_atmel_unlock; |
257 | mtd->flags |= MTD_POWERUP_LOCK; | 257 | mtd->flags |= MTD_POWERUP_LOCK; |
258 | } | 258 | } |
259 | 259 | ||
@@ -432,12 +432,12 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) | |||
432 | mtd->type = MTD_NORFLASH; | 432 | mtd->type = MTD_NORFLASH; |
433 | 433 | ||
434 | /* Fill in the default mtd operations */ | 434 | /* Fill in the default mtd operations */ |
435 | mtd->erase = cfi_amdstd_erase_varsize; | 435 | mtd->_erase = cfi_amdstd_erase_varsize; |
436 | mtd->write = cfi_amdstd_write_words; | 436 | mtd->_write = cfi_amdstd_write_words; |
437 | mtd->read = cfi_amdstd_read; | 437 | mtd->_read = cfi_amdstd_read; |
438 | mtd->sync = cfi_amdstd_sync; | 438 | mtd->_sync = cfi_amdstd_sync; |
439 | mtd->suspend = cfi_amdstd_suspend; | 439 | mtd->_suspend = cfi_amdstd_suspend; |
440 | mtd->resume = cfi_amdstd_resume; | 440 | mtd->_resume = cfi_amdstd_resume; |
441 | mtd->flags = MTD_CAP_NORFLASH; | 441 | mtd->flags = MTD_CAP_NORFLASH; |
442 | mtd->name = map->name; | 442 | mtd->name = map->name; |
443 | mtd->writesize = 1; | 443 | mtd->writesize = 1; |
@@ -446,7 +446,7 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) | |||
446 | pr_debug("MTD %s(): write buffer size %d\n", __func__, | 446 | pr_debug("MTD %s(): write buffer size %d\n", __func__, |
447 | mtd->writebufsize); | 447 | mtd->writebufsize); |
448 | 448 | ||
449 | mtd->panic_write = cfi_amdstd_panic_write; | 449 | mtd->_panic_write = cfi_amdstd_panic_write; |
450 | mtd->reboot_notifier.notifier_call = cfi_amdstd_reboot; | 450 | mtd->reboot_notifier.notifier_call = cfi_amdstd_reboot; |
451 | 451 | ||
452 | if (cfi->cfi_mode==CFI_MODE_CFI){ | 452 | if (cfi->cfi_mode==CFI_MODE_CFI){ |
diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c index 85e80180b65b..3861cca97bb0 100644 --- a/drivers/mtd/chips/cfi_cmdset_0020.c +++ b/drivers/mtd/chips/cfi_cmdset_0020.c | |||
@@ -228,15 +228,15 @@ static struct mtd_info *cfi_staa_setup(struct map_info *map) | |||
228 | } | 228 | } |
229 | 229 | ||
230 | /* Also select the correct geometry setup too */ | 230 | /* Also select the correct geometry setup too */ |
231 | mtd->erase = cfi_staa_erase_varsize; | 231 | mtd->_erase = cfi_staa_erase_varsize; |
232 | mtd->read = cfi_staa_read; | 232 | mtd->_read = cfi_staa_read; |
233 | mtd->write = cfi_staa_write_buffers; | 233 | mtd->_write = cfi_staa_write_buffers; |
234 | mtd->writev = cfi_staa_writev; | 234 | mtd->_writev = cfi_staa_writev; |
235 | mtd->sync = cfi_staa_sync; | 235 | mtd->_sync = cfi_staa_sync; |
236 | mtd->lock = cfi_staa_lock; | 236 | mtd->_lock = cfi_staa_lock; |
237 | mtd->unlock = cfi_staa_unlock; | 237 | mtd->_unlock = cfi_staa_unlock; |
238 | mtd->suspend = cfi_staa_suspend; | 238 | mtd->_suspend = cfi_staa_suspend; |
239 | mtd->resume = cfi_staa_resume; | 239 | mtd->_resume = cfi_staa_resume; |
240 | mtd->flags = MTD_CAP_NORFLASH & ~MTD_BIT_WRITEABLE; | 240 | mtd->flags = MTD_CAP_NORFLASH & ~MTD_BIT_WRITEABLE; |
241 | mtd->writesize = 8; /* FIXME: Should be 0 for STMicro flashes w/out ECC */ | 241 | mtd->writesize = 8; /* FIXME: Should be 0 for STMicro flashes w/out ECC */ |
242 | mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; | 242 | mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; |
diff --git a/drivers/mtd/chips/fwh_lock.h b/drivers/mtd/chips/fwh_lock.h index 89c6595454a5..800b0e853e86 100644 --- a/drivers/mtd/chips/fwh_lock.h +++ b/drivers/mtd/chips/fwh_lock.h | |||
@@ -101,7 +101,7 @@ static void fixup_use_fwh_lock(struct mtd_info *mtd) | |||
101 | { | 101 | { |
102 | printk(KERN_NOTICE "using fwh lock/unlock method\n"); | 102 | printk(KERN_NOTICE "using fwh lock/unlock method\n"); |
103 | /* Setup for the chips with the fwh lock method */ | 103 | /* Setup for the chips with the fwh lock method */ |
104 | mtd->lock = fwh_lock_varsize; | 104 | mtd->_lock = fwh_lock_varsize; |
105 | mtd->unlock = fwh_unlock_varsize; | 105 | mtd->_unlock = fwh_unlock_varsize; |
106 | } | 106 | } |
107 | #endif /* FWH_LOCK_H */ | 107 | #endif /* FWH_LOCK_H */ |
diff --git a/drivers/mtd/chips/map_absent.c b/drivers/mtd/chips/map_absent.c index f2b872946871..6be2eddfea45 100644 --- a/drivers/mtd/chips/map_absent.c +++ b/drivers/mtd/chips/map_absent.c | |||
@@ -55,10 +55,10 @@ static struct mtd_info *map_absent_probe(struct map_info *map) | |||
55 | mtd->name = map->name; | 55 | mtd->name = map->name; |
56 | mtd->type = MTD_ABSENT; | 56 | mtd->type = MTD_ABSENT; |
57 | mtd->size = map->size; | 57 | mtd->size = map->size; |
58 | mtd->erase = map_absent_erase; | 58 | mtd->_erase = map_absent_erase; |
59 | mtd->read = map_absent_read; | 59 | mtd->_read = map_absent_read; |
60 | mtd->write = map_absent_write; | 60 | mtd->_write = map_absent_write; |
61 | mtd->sync = map_absent_sync; | 61 | mtd->_sync = map_absent_sync; |
62 | mtd->flags = 0; | 62 | mtd->flags = 0; |
63 | mtd->erasesize = PAGE_SIZE; | 63 | mtd->erasesize = PAGE_SIZE; |
64 | mtd->writesize = 1; | 64 | mtd->writesize = 1; |
diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c index 67640ccb2d41..225307088dc0 100644 --- a/drivers/mtd/chips/map_ram.c +++ b/drivers/mtd/chips/map_ram.c | |||
@@ -64,11 +64,11 @@ static struct mtd_info *map_ram_probe(struct map_info *map) | |||
64 | mtd->name = map->name; | 64 | mtd->name = map->name; |
65 | mtd->type = MTD_RAM; | 65 | mtd->type = MTD_RAM; |
66 | mtd->size = map->size; | 66 | mtd->size = map->size; |
67 | mtd->erase = mapram_erase; | 67 | mtd->_erase = mapram_erase; |
68 | mtd->get_unmapped_area = mapram_unmapped_area; | 68 | mtd->_get_unmapped_area = mapram_unmapped_area; |
69 | mtd->read = mapram_read; | 69 | mtd->_read = mapram_read; |
70 | mtd->write = mapram_write; | 70 | mtd->_write = mapram_write; |
71 | mtd->sync = mapram_nop; | 71 | mtd->_sync = mapram_nop; |
72 | mtd->flags = MTD_CAP_RAM; | 72 | mtd->flags = MTD_CAP_RAM; |
73 | mtd->writesize = 1; | 73 | mtd->writesize = 1; |
74 | 74 | ||
diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c index 593f73d480d2..facb56092d39 100644 --- a/drivers/mtd/chips/map_rom.c +++ b/drivers/mtd/chips/map_rom.c | |||
@@ -41,11 +41,11 @@ static struct mtd_info *map_rom_probe(struct map_info *map) | |||
41 | mtd->name = map->name; | 41 | mtd->name = map->name; |
42 | mtd->type = MTD_ROM; | 42 | mtd->type = MTD_ROM; |
43 | mtd->size = map->size; | 43 | mtd->size = map->size; |
44 | mtd->get_unmapped_area = maprom_unmapped_area; | 44 | mtd->_get_unmapped_area = maprom_unmapped_area; |
45 | mtd->read = maprom_read; | 45 | mtd->_read = maprom_read; |
46 | mtd->write = maprom_write; | 46 | mtd->_write = maprom_write; |
47 | mtd->sync = maprom_nop; | 47 | mtd->_sync = maprom_nop; |
48 | mtd->erase = maprom_erase; | 48 | mtd->_erase = maprom_erase; |
49 | mtd->flags = MTD_CAP_ROM; | 49 | mtd->flags = MTD_CAP_ROM; |
50 | mtd->erasesize = map->size; | 50 | mtd->erasesize = map->size; |
51 | mtd->writesize = 1; | 51 | mtd->writesize = 1; |
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c index e7e46d1e7463..d9e75dafdd45 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c | |||
@@ -285,11 +285,11 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size) | |||
285 | dev->mtd.writesize = 1; | 285 | dev->mtd.writesize = 1; |
286 | dev->mtd.type = MTD_RAM; | 286 | dev->mtd.type = MTD_RAM; |
287 | dev->mtd.flags = MTD_CAP_RAM; | 287 | dev->mtd.flags = MTD_CAP_RAM; |
288 | dev->mtd.erase = block2mtd_erase; | 288 | dev->mtd._erase = block2mtd_erase; |
289 | dev->mtd.write = block2mtd_write; | 289 | dev->mtd._write = block2mtd_write; |
290 | dev->mtd.writev = mtd_writev; | 290 | dev->mtd._writev = mtd_writev; |
291 | dev->mtd.sync = block2mtd_sync; | 291 | dev->mtd._sync = block2mtd_sync; |
292 | dev->mtd.read = block2mtd_read; | 292 | dev->mtd._read = block2mtd_read; |
293 | dev->mtd.priv = dev; | 293 | dev->mtd.priv = dev; |
294 | dev->mtd.owner = THIS_MODULE; | 294 | dev->mtd.owner = THIS_MODULE; |
295 | 295 | ||
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c index b1cdf6479019..ffd01a66a175 100644 --- a/drivers/mtd/devices/doc2000.c +++ b/drivers/mtd/devices/doc2000.c | |||
@@ -565,11 +565,11 @@ void DoC2k_init(struct mtd_info *mtd) | |||
565 | mtd->writesize = 512; | 565 | mtd->writesize = 512; |
566 | mtd->oobsize = 16; | 566 | mtd->oobsize = 16; |
567 | mtd->owner = THIS_MODULE; | 567 | mtd->owner = THIS_MODULE; |
568 | mtd->erase = doc_erase; | 568 | mtd->_erase = doc_erase; |
569 | mtd->read = doc_read; | 569 | mtd->_read = doc_read; |
570 | mtd->write = doc_write; | 570 | mtd->_write = doc_write; |
571 | mtd->read_oob = doc_read_oob; | 571 | mtd->_read_oob = doc_read_oob; |
572 | mtd->write_oob = doc_write_oob; | 572 | mtd->_write_oob = doc_write_oob; |
573 | this->curfloor = -1; | 573 | this->curfloor = -1; |
574 | this->curchip = -1; | 574 | this->curchip = -1; |
575 | mutex_init(&this->lock); | 575 | mutex_init(&this->lock); |
diff --git a/drivers/mtd/devices/doc2001.c b/drivers/mtd/devices/doc2001.c index 7543b98f46c4..3785733650cb 100644 --- a/drivers/mtd/devices/doc2001.c +++ b/drivers/mtd/devices/doc2001.c | |||
@@ -349,11 +349,11 @@ void DoCMil_init(struct mtd_info *mtd) | |||
349 | mtd->writesize = 512; | 349 | mtd->writesize = 512; |
350 | mtd->oobsize = 16; | 350 | mtd->oobsize = 16; |
351 | mtd->owner = THIS_MODULE; | 351 | mtd->owner = THIS_MODULE; |
352 | mtd->erase = doc_erase; | 352 | mtd->_erase = doc_erase; |
353 | mtd->read = doc_read; | 353 | mtd->_read = doc_read; |
354 | mtd->write = doc_write; | 354 | mtd->_write = doc_write; |
355 | mtd->read_oob = doc_read_oob; | 355 | mtd->_read_oob = doc_read_oob; |
356 | mtd->write_oob = doc_write_oob; | 356 | mtd->_write_oob = doc_write_oob; |
357 | this->curfloor = -1; | 357 | this->curfloor = -1; |
358 | this->curchip = -1; | 358 | this->curchip = -1; |
359 | 359 | ||
diff --git a/drivers/mtd/devices/doc2001plus.c b/drivers/mtd/devices/doc2001plus.c index 177510d0e7ee..409fa3174cc4 100644 --- a/drivers/mtd/devices/doc2001plus.c +++ b/drivers/mtd/devices/doc2001plus.c | |||
@@ -470,11 +470,11 @@ void DoCMilPlus_init(struct mtd_info *mtd) | |||
470 | mtd->writesize = 512; | 470 | mtd->writesize = 512; |
471 | mtd->oobsize = 16; | 471 | mtd->oobsize = 16; |
472 | mtd->owner = THIS_MODULE; | 472 | mtd->owner = THIS_MODULE; |
473 | mtd->erase = doc_erase; | 473 | mtd->_erase = doc_erase; |
474 | mtd->read = doc_read; | 474 | mtd->_read = doc_read; |
475 | mtd->write = doc_write; | 475 | mtd->_write = doc_write; |
476 | mtd->read_oob = doc_read_oob; | 476 | mtd->_read_oob = doc_read_oob; |
477 | mtd->write_oob = doc_write_oob; | 477 | mtd->_write_oob = doc_write_oob; |
478 | this->curfloor = -1; | 478 | this->curfloor = -1; |
479 | this->curchip = -1; | 479 | this->curchip = -1; |
480 | 480 | ||
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c index ad11ef0a81f4..3746ae8ff0a2 100644 --- a/drivers/mtd/devices/docg3.c +++ b/drivers/mtd/devices/docg3.c | |||
@@ -1820,12 +1820,12 @@ static void __init doc_set_driver_info(int chip_id, struct mtd_info *mtd) | |||
1820 | mtd->writesize = DOC_LAYOUT_PAGE_SIZE; | 1820 | mtd->writesize = DOC_LAYOUT_PAGE_SIZE; |
1821 | mtd->oobsize = DOC_LAYOUT_OOB_SIZE; | 1821 | mtd->oobsize = DOC_LAYOUT_OOB_SIZE; |
1822 | mtd->owner = THIS_MODULE; | 1822 | mtd->owner = THIS_MODULE; |
1823 | mtd->erase = doc_erase; | 1823 | mtd->_erase = doc_erase; |
1824 | mtd->read = doc_read; | 1824 | mtd->_read = doc_read; |
1825 | mtd->write = doc_write; | 1825 | mtd->_write = doc_write; |
1826 | mtd->read_oob = doc_read_oob; | 1826 | mtd->_read_oob = doc_read_oob; |
1827 | mtd->write_oob = doc_write_oob; | 1827 | mtd->_write_oob = doc_write_oob; |
1828 | mtd->block_isbad = doc_block_isbad; | 1828 | mtd->_block_isbad = doc_block_isbad; |
1829 | mtd->ecclayout = &docg3_oobinfo; | 1829 | mtd->ecclayout = &docg3_oobinfo; |
1830 | } | 1830 | } |
1831 | 1831 | ||
diff --git a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c index 3a11ea628e58..a59584871af5 100644 --- a/drivers/mtd/devices/lart.c +++ b/drivers/mtd/devices/lart.c | |||
@@ -635,9 +635,9 @@ static int __init lart_flash_init (void) | |||
635 | mtd.erasesize = FLASH_BLOCKSIZE_MAIN; | 635 | mtd.erasesize = FLASH_BLOCKSIZE_MAIN; |
636 | mtd.numeraseregions = ARRAY_SIZE(erase_regions); | 636 | mtd.numeraseregions = ARRAY_SIZE(erase_regions); |
637 | mtd.eraseregions = erase_regions; | 637 | mtd.eraseregions = erase_regions; |
638 | mtd.erase = flash_erase; | 638 | mtd._erase = flash_erase; |
639 | mtd.read = flash_read; | 639 | mtd._read = flash_read; |
640 | mtd.write = flash_write; | 640 | mtd._write = flash_write; |
641 | mtd.owner = THIS_MODULE; | 641 | mtd.owner = THIS_MODULE; |
642 | 642 | ||
643 | #ifdef LART_DEBUG | 643 | #ifdef LART_DEBUG |
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 230b02e336ab..f83e4d0366cc 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c | |||
@@ -908,14 +908,14 @@ static int __devinit m25p_probe(struct spi_device *spi) | |||
908 | flash->mtd.writesize = 1; | 908 | flash->mtd.writesize = 1; |
909 | flash->mtd.flags = MTD_CAP_NORFLASH; | 909 | flash->mtd.flags = MTD_CAP_NORFLASH; |
910 | flash->mtd.size = info->sector_size * info->n_sectors; | 910 | flash->mtd.size = info->sector_size * info->n_sectors; |
911 | flash->mtd.erase = m25p80_erase; | 911 | flash->mtd._erase = m25p80_erase; |
912 | flash->mtd.read = m25p80_read; | 912 | flash->mtd._read = m25p80_read; |
913 | 913 | ||
914 | /* sst flash chips use AAI word program */ | 914 | /* sst flash chips use AAI word program */ |
915 | if (JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) | 915 | if (JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) |
916 | flash->mtd.write = sst_write; | 916 | flash->mtd._write = sst_write; |
917 | else | 917 | else |
918 | flash->mtd.write = m25p80_write; | 918 | flash->mtd._write = m25p80_write; |
919 | 919 | ||
920 | /* prefer "small sector" erase if possible */ | 920 | /* prefer "small sector" erase if possible */ |
921 | if (info->flags & SECT_4K) { | 921 | if (info->flags & SECT_4K) { |
diff --git a/drivers/mtd/devices/ms02-nv.c b/drivers/mtd/devices/ms02-nv.c index 8423fb6d4f26..3a05af529e7d 100644 --- a/drivers/mtd/devices/ms02-nv.c +++ b/drivers/mtd/devices/ms02-nv.c | |||
@@ -215,8 +215,8 @@ static int __init ms02nv_init_one(ulong addr) | |||
215 | mtd->size = fixsize; | 215 | mtd->size = fixsize; |
216 | mtd->name = (char *)ms02nv_name; | 216 | mtd->name = (char *)ms02nv_name; |
217 | mtd->owner = THIS_MODULE; | 217 | mtd->owner = THIS_MODULE; |
218 | mtd->read = ms02nv_read; | 218 | mtd->_read = ms02nv_read; |
219 | mtd->write = ms02nv_write; | 219 | mtd->_write = ms02nv_write; |
220 | mtd->writesize = 1; | 220 | mtd->writesize = 1; |
221 | 221 | ||
222 | ret = -EIO; | 222 | ret = -EIO; |
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 5ec5fc9fe045..fd4a9fc0d8b8 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c | |||
@@ -611,16 +611,16 @@ static int dataflash_write_user_otp(struct mtd_info *mtd, | |||
611 | 611 | ||
612 | static char *otp_setup(struct mtd_info *device, char revision) | 612 | static char *otp_setup(struct mtd_info *device, char revision) |
613 | { | 613 | { |
614 | device->get_fact_prot_info = dataflash_get_otp_info; | 614 | device->_get_fact_prot_info = dataflash_get_otp_info; |
615 | device->read_fact_prot_reg = dataflash_read_fact_otp; | 615 | device->_read_fact_prot_reg = dataflash_read_fact_otp; |
616 | device->get_user_prot_info = dataflash_get_otp_info; | 616 | device->_get_user_prot_info = dataflash_get_otp_info; |
617 | device->read_user_prot_reg = dataflash_read_user_otp; | 617 | device->_read_user_prot_reg = dataflash_read_user_otp; |
618 | 618 | ||
619 | /* rev c parts (at45db321c and at45db1281 only!) use a | 619 | /* rev c parts (at45db321c and at45db1281 only!) use a |
620 | * different write procedure; not (yet?) implemented. | 620 | * different write procedure; not (yet?) implemented. |
621 | */ | 621 | */ |
622 | if (revision > 'c') | 622 | if (revision > 'c') |
623 | device->write_user_prot_reg = dataflash_write_user_otp; | 623 | device->_write_user_prot_reg = dataflash_write_user_otp; |
624 | 624 | ||
625 | return ", OTP"; | 625 | return ", OTP"; |
626 | } | 626 | } |
@@ -672,9 +672,9 @@ add_dataflash_otp(struct spi_device *spi, char *name, | |||
672 | device->owner = THIS_MODULE; | 672 | device->owner = THIS_MODULE; |
673 | device->type = MTD_DATAFLASH; | 673 | device->type = MTD_DATAFLASH; |
674 | device->flags = MTD_WRITEABLE; | 674 | device->flags = MTD_WRITEABLE; |
675 | device->erase = dataflash_erase; | 675 | device->_erase = dataflash_erase; |
676 | device->read = dataflash_read; | 676 | device->_read = dataflash_read; |
677 | device->write = dataflash_write; | 677 | device->_write = dataflash_write; |
678 | device->priv = priv; | 678 | device->priv = priv; |
679 | 679 | ||
680 | device->dev.parent = &spi->dev; | 680 | device->dev.parent = &spi->dev; |
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c index 2562689ba6b4..91030cfb03b3 100644 --- a/drivers/mtd/devices/mtdram.c +++ b/drivers/mtd/devices/mtdram.c | |||
@@ -126,12 +126,12 @@ int mtdram_init_device(struct mtd_info *mtd, void *mapped_address, | |||
126 | mtd->priv = mapped_address; | 126 | mtd->priv = mapped_address; |
127 | 127 | ||
128 | mtd->owner = THIS_MODULE; | 128 | mtd->owner = THIS_MODULE; |
129 | mtd->erase = ram_erase; | 129 | mtd->_erase = ram_erase; |
130 | mtd->point = ram_point; | 130 | mtd->_point = ram_point; |
131 | mtd->unpoint = ram_unpoint; | 131 | mtd->_unpoint = ram_unpoint; |
132 | mtd->get_unmapped_area = ram_get_unmapped_area; | 132 | mtd->_get_unmapped_area = ram_get_unmapped_area; |
133 | mtd->read = ram_read; | 133 | mtd->_read = ram_read; |
134 | mtd->write = ram_write; | 134 | mtd->_write = ram_write; |
135 | 135 | ||
136 | if (mtd_device_register(mtd, NULL, 0)) | 136 | if (mtd_device_register(mtd, NULL, 0)) |
137 | return -EIO; | 137 | return -EIO; |
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c index 23423bd00b06..eff2b69864f5 100644 --- a/drivers/mtd/devices/phram.c +++ b/drivers/mtd/devices/phram.c | |||
@@ -142,11 +142,11 @@ static int register_device(char *name, unsigned long start, unsigned long len) | |||
142 | new->mtd.name = name; | 142 | new->mtd.name = name; |
143 | new->mtd.size = len; | 143 | new->mtd.size = len; |
144 | new->mtd.flags = MTD_CAP_RAM; | 144 | new->mtd.flags = MTD_CAP_RAM; |
145 | new->mtd.erase = phram_erase; | 145 | new->mtd._erase = phram_erase; |
146 | new->mtd.point = phram_point; | 146 | new->mtd._point = phram_point; |
147 | new->mtd.unpoint = phram_unpoint; | 147 | new->mtd._unpoint = phram_unpoint; |
148 | new->mtd.read = phram_read; | 148 | new->mtd._read = phram_read; |
149 | new->mtd.write = phram_write; | 149 | new->mtd._write = phram_write; |
150 | new->mtd.owner = THIS_MODULE; | 150 | new->mtd.owner = THIS_MODULE; |
151 | new->mtd.type = MTD_RAM; | 151 | new->mtd.type = MTD_RAM; |
152 | new->mtd.erasesize = PAGE_SIZE; | 152 | new->mtd.erasesize = PAGE_SIZE; |
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index cfccf6510411..67d22e1cbc0e 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c | |||
@@ -787,11 +787,11 @@ static int __init init_pmc551(void) | |||
787 | 787 | ||
788 | mtd->size = msize; | 788 | mtd->size = msize; |
789 | mtd->flags = MTD_CAP_RAM; | 789 | mtd->flags = MTD_CAP_RAM; |
790 | mtd->erase = pmc551_erase; | 790 | mtd->_erase = pmc551_erase; |
791 | mtd->read = pmc551_read; | 791 | mtd->_read = pmc551_read; |
792 | mtd->write = pmc551_write; | 792 | mtd->_write = pmc551_write; |
793 | mtd->point = pmc551_point; | 793 | mtd->_point = pmc551_point; |
794 | mtd->unpoint = pmc551_unpoint; | 794 | mtd->_unpoint = pmc551_unpoint; |
795 | mtd->type = MTD_RAM; | 795 | mtd->type = MTD_RAM; |
796 | mtd->name = "PMC551 RAM board"; | 796 | mtd->name = "PMC551 RAM board"; |
797 | mtd->erasesize = 0x10000; | 797 | mtd->erasesize = 0x10000; |
diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c index e585263161b9..cbeb19522bbc 100644 --- a/drivers/mtd/devices/slram.c +++ b/drivers/mtd/devices/slram.c | |||
@@ -200,11 +200,11 @@ static int register_device(char *name, unsigned long start, unsigned long length | |||
200 | (*curmtd)->mtdinfo->name = name; | 200 | (*curmtd)->mtdinfo->name = name; |
201 | (*curmtd)->mtdinfo->size = length; | 201 | (*curmtd)->mtdinfo->size = length; |
202 | (*curmtd)->mtdinfo->flags = MTD_CAP_RAM; | 202 | (*curmtd)->mtdinfo->flags = MTD_CAP_RAM; |
203 | (*curmtd)->mtdinfo->erase = slram_erase; | 203 | (*curmtd)->mtdinfo->_erase = slram_erase; |
204 | (*curmtd)->mtdinfo->point = slram_point; | 204 | (*curmtd)->mtdinfo->_point = slram_point; |
205 | (*curmtd)->mtdinfo->unpoint = slram_unpoint; | 205 | (*curmtd)->mtdinfo->_unpoint = slram_unpoint; |
206 | (*curmtd)->mtdinfo->read = slram_read; | 206 | (*curmtd)->mtdinfo->_read = slram_read; |
207 | (*curmtd)->mtdinfo->write = slram_write; | 207 | (*curmtd)->mtdinfo->_write = slram_write; |
208 | (*curmtd)->mtdinfo->owner = THIS_MODULE; | 208 | (*curmtd)->mtdinfo->owner = THIS_MODULE; |
209 | (*curmtd)->mtdinfo->type = MTD_RAM; | 209 | (*curmtd)->mtdinfo->type = MTD_RAM; |
210 | (*curmtd)->mtdinfo->erasesize = SLRAM_BLK_SZ; | 210 | (*curmtd)->mtdinfo->erasesize = SLRAM_BLK_SZ; |
diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c index 0f0f1ac06493..5f4254254641 100644 --- a/drivers/mtd/devices/spear_smi.c +++ b/drivers/mtd/devices/spear_smi.c | |||
@@ -846,9 +846,9 @@ static int spear_smi_setup_banks(struct platform_device *pdev, u32 bank) | |||
846 | flash->mtd.erasesize = flash_devices[flash_index].sectorsize; | 846 | flash->mtd.erasesize = flash_devices[flash_index].sectorsize; |
847 | flash->page_size = flash_devices[flash_index].pagesize; | 847 | flash->page_size = flash_devices[flash_index].pagesize; |
848 | flash->erase_cmd = flash_devices[flash_index].erase_cmd; | 848 | flash->erase_cmd = flash_devices[flash_index].erase_cmd; |
849 | flash->mtd.erase = spear_mtd_erase; | 849 | flash->mtd._erase = spear_mtd_erase; |
850 | flash->mtd.read = spear_mtd_read; | 850 | flash->mtd._read = spear_mtd_read; |
851 | flash->mtd.write = spear_mtd_write; | 851 | flash->mtd._write = spear_mtd_write; |
852 | flash->dev_id = flash_devices[flash_index].device_id; | 852 | flash->dev_id = flash_devices[flash_index].device_id; |
853 | 853 | ||
854 | dev_info(&dev->pdev->dev, "mtd .name=%s .size=%llx(%lluM)\n", | 854 | dev_info(&dev->pdev->dev, "mtd .name=%s .size=%llx(%lluM)\n", |
diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c index 196fd95b19d6..a665eba96e7f 100644 --- a/drivers/mtd/devices/sst25l.c +++ b/drivers/mtd/devices/sst25l.c | |||
@@ -403,9 +403,9 @@ static int __devinit sst25l_probe(struct spi_device *spi) | |||
403 | flash->mtd.erasesize = flash_info->erase_size; | 403 | flash->mtd.erasesize = flash_info->erase_size; |
404 | flash->mtd.writesize = flash_info->page_size; | 404 | flash->mtd.writesize = flash_info->page_size; |
405 | flash->mtd.size = flash_info->page_size * flash_info->nr_pages; | 405 | flash->mtd.size = flash_info->page_size * flash_info->nr_pages; |
406 | flash->mtd.erase = sst25l_erase; | 406 | flash->mtd._erase = sst25l_erase; |
407 | flash->mtd.read = sst25l_read; | 407 | flash->mtd._read = sst25l_read; |
408 | flash->mtd.write = sst25l_write; | 408 | flash->mtd._write = sst25l_write; |
409 | 409 | ||
410 | dev_info(&spi->dev, "%s (%lld KiB)\n", flash_info->name, | 410 | dev_info(&spi->dev, "%s (%lld KiB)\n", flash_info->name, |
411 | (long long)flash->mtd.size >> 10); | 411 | (long long)flash->mtd.size >> 10); |
diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c index 28646c95cfb8..3af351484098 100644 --- a/drivers/mtd/inftlcore.c +++ b/drivers/mtd/inftlcore.c | |||
@@ -56,7 +56,7 @@ static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
56 | if (memcmp(mtd->name, "DiskOnChip", 10)) | 56 | if (memcmp(mtd->name, "DiskOnChip", 10)) |
57 | return; | 57 | return; |
58 | 58 | ||
59 | if (!mtd->block_isbad) { | 59 | if (!mtd->_block_isbad) { |
60 | printk(KERN_ERR | 60 | printk(KERN_ERR |
61 | "INFTL no longer supports the old DiskOnChip drivers loaded via docprobe.\n" | 61 | "INFTL no longer supports the old DiskOnChip drivers loaded via docprobe.\n" |
62 | "Please use the new diskonchip driver under the NAND subsystem.\n"); | 62 | "Please use the new diskonchip driver under the NAND subsystem.\n"); |
diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c index 536bbceaeaad..fd19d3b1ee90 100644 --- a/drivers/mtd/lpddr/lpddr_cmds.c +++ b/drivers/mtd/lpddr/lpddr_cmds.c | |||
@@ -63,18 +63,18 @@ struct mtd_info *lpddr_cmdset(struct map_info *map) | |||
63 | mtd->type = MTD_NORFLASH; | 63 | mtd->type = MTD_NORFLASH; |
64 | 64 | ||
65 | /* Fill in the default mtd operations */ | 65 | /* Fill in the default mtd operations */ |
66 | mtd->read = lpddr_read; | 66 | mtd->_read = lpddr_read; |
67 | mtd->type = MTD_NORFLASH; | 67 | mtd->type = MTD_NORFLASH; |
68 | mtd->flags = MTD_CAP_NORFLASH; | 68 | mtd->flags = MTD_CAP_NORFLASH; |
69 | mtd->flags &= ~MTD_BIT_WRITEABLE; | 69 | mtd->flags &= ~MTD_BIT_WRITEABLE; |
70 | mtd->erase = lpddr_erase; | 70 | mtd->_erase = lpddr_erase; |
71 | mtd->write = lpddr_write_buffers; | 71 | mtd->_write = lpddr_write_buffers; |
72 | mtd->writev = lpddr_writev; | 72 | mtd->_writev = lpddr_writev; |
73 | mtd->lock = lpddr_lock; | 73 | mtd->_lock = lpddr_lock; |
74 | mtd->unlock = lpddr_unlock; | 74 | mtd->_unlock = lpddr_unlock; |
75 | if (map_is_linear(map)) { | 75 | if (map_is_linear(map)) { |
76 | mtd->point = lpddr_point; | 76 | mtd->_point = lpddr_point; |
77 | mtd->unpoint = lpddr_unpoint; | 77 | mtd->_unpoint = lpddr_unpoint; |
78 | } | 78 | } |
79 | mtd->size = 1 << lpddr->qinfo->DevSizeShift; | 79 | mtd->size = 1 << lpddr->qinfo->DevSizeShift; |
80 | mtd->erasesize = 1 << lpddr->qinfo->UniformBlockSizeShift; | 80 | mtd->erasesize = 1 << lpddr->qinfo->UniformBlockSizeShift; |
diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c index 6793074f3f40..cfff454f628b 100644 --- a/drivers/mtd/maps/uclinux.c +++ b/drivers/mtd/maps/uclinux.c | |||
@@ -85,7 +85,7 @@ static int __init uclinux_mtd_init(void) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | mtd->owner = THIS_MODULE; | 87 | mtd->owner = THIS_MODULE; |
88 | mtd->point = uclinux_point; | 88 | mtd->_point = uclinux_point; |
89 | mtd->priv = mapp; | 89 | mtd->priv = mapp; |
90 | 90 | ||
91 | uclinux_ram_mtdinfo = mtd; | 91 | uclinux_ram_mtdinfo = mtd; |
diff --git a/drivers/mtd/maps/vmu-flash.c b/drivers/mtd/maps/vmu-flash.c index 3a04b078576a..48a803e2cd2e 100644 --- a/drivers/mtd/maps/vmu-flash.c +++ b/drivers/mtd/maps/vmu-flash.c | |||
@@ -544,9 +544,9 @@ static void vmu_queryblocks(struct mapleq *mq) | |||
544 | mtd_cur->flags = MTD_WRITEABLE|MTD_NO_ERASE; | 544 | mtd_cur->flags = MTD_WRITEABLE|MTD_NO_ERASE; |
545 | mtd_cur->size = part_cur->numblocks * card->blocklen; | 545 | mtd_cur->size = part_cur->numblocks * card->blocklen; |
546 | mtd_cur->erasesize = card->blocklen; | 546 | mtd_cur->erasesize = card->blocklen; |
547 | mtd_cur->write = vmu_flash_write; | 547 | mtd_cur->_write = vmu_flash_write; |
548 | mtd_cur->read = vmu_flash_read; | 548 | mtd_cur->_read = vmu_flash_read; |
549 | mtd_cur->sync = vmu_flash_sync; | 549 | mtd_cur->_sync = vmu_flash_sync; |
550 | mtd_cur->writesize = card->blocklen; | 550 | mtd_cur->writesize = card->blocklen; |
551 | 551 | ||
552 | mpart = kmalloc(sizeof(struct mdev_part), GFP_KERNEL); | 552 | mpart = kmalloc(sizeof(struct mdev_part), GFP_KERNEL); |
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 50c6a1e7f675..426640eaf818 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -405,7 +405,7 @@ static int mtdchar_writeoob(struct file *file, struct mtd_info *mtd, | |||
405 | if (length > 4096) | 405 | if (length > 4096) |
406 | return -EINVAL; | 406 | return -EINVAL; |
407 | 407 | ||
408 | if (!mtd->write_oob) | 408 | if (!mtd->_write_oob) |
409 | ret = -EOPNOTSUPP; | 409 | ret = -EOPNOTSUPP; |
410 | else | 410 | else |
411 | ret = access_ok(VERIFY_READ, ptr, length) ? 0 : -EFAULT; | 411 | ret = access_ok(VERIFY_READ, ptr, length) ? 0 : -EFAULT; |
@@ -576,7 +576,7 @@ static int mtdchar_write_ioctl(struct mtd_info *mtd, | |||
576 | !access_ok(VERIFY_READ, req.usr_data, req.len) || | 576 | !access_ok(VERIFY_READ, req.usr_data, req.len) || |
577 | !access_ok(VERIFY_READ, req.usr_oob, req.ooblen)) | 577 | !access_ok(VERIFY_READ, req.usr_oob, req.ooblen)) |
578 | return -EFAULT; | 578 | return -EFAULT; |
579 | if (!mtd->write_oob) | 579 | if (!mtd->_write_oob) |
580 | return -EOPNOTSUPP; | 580 | return -EOPNOTSUPP; |
581 | 581 | ||
582 | ops.mode = req.mode; | 582 | ops.mode = req.mode; |
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index 1ed5103b219b..5c7eb69c4ed9 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c | |||
@@ -777,16 +777,16 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c | |||
777 | concat->mtd.subpage_sft = subdev[0]->subpage_sft; | 777 | concat->mtd.subpage_sft = subdev[0]->subpage_sft; |
778 | concat->mtd.oobsize = subdev[0]->oobsize; | 778 | concat->mtd.oobsize = subdev[0]->oobsize; |
779 | concat->mtd.oobavail = subdev[0]->oobavail; | 779 | concat->mtd.oobavail = subdev[0]->oobavail; |
780 | if (subdev[0]->writev) | 780 | if (subdev[0]->_writev) |
781 | concat->mtd.writev = concat_writev; | 781 | concat->mtd._writev = concat_writev; |
782 | if (subdev[0]->read_oob) | 782 | if (subdev[0]->_read_oob) |
783 | concat->mtd.read_oob = concat_read_oob; | 783 | concat->mtd._read_oob = concat_read_oob; |
784 | if (subdev[0]->write_oob) | 784 | if (subdev[0]->_write_oob) |
785 | concat->mtd.write_oob = concat_write_oob; | 785 | concat->mtd._write_oob = concat_write_oob; |
786 | if (subdev[0]->block_isbad) | 786 | if (subdev[0]->_block_isbad) |
787 | concat->mtd.block_isbad = concat_block_isbad; | 787 | concat->mtd._block_isbad = concat_block_isbad; |
788 | if (subdev[0]->block_markbad) | 788 | if (subdev[0]->_block_markbad) |
789 | concat->mtd.block_markbad = concat_block_markbad; | 789 | concat->mtd._block_markbad = concat_block_markbad; |
790 | 790 | ||
791 | concat->mtd.ecc_stats.badblocks = subdev[0]->ecc_stats.badblocks; | 791 | concat->mtd.ecc_stats.badblocks = subdev[0]->ecc_stats.badblocks; |
792 | 792 | ||
@@ -833,8 +833,8 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c | |||
833 | if (concat->mtd.writesize != subdev[i]->writesize || | 833 | if (concat->mtd.writesize != subdev[i]->writesize || |
834 | concat->mtd.subpage_sft != subdev[i]->subpage_sft || | 834 | concat->mtd.subpage_sft != subdev[i]->subpage_sft || |
835 | concat->mtd.oobsize != subdev[i]->oobsize || | 835 | concat->mtd.oobsize != subdev[i]->oobsize || |
836 | !concat->mtd.read_oob != !subdev[i]->read_oob || | 836 | !concat->mtd._read_oob != !subdev[i]->_read_oob || |
837 | !concat->mtd.write_oob != !subdev[i]->write_oob) { | 837 | !concat->mtd._write_oob != !subdev[i]->_write_oob) { |
838 | kfree(concat); | 838 | kfree(concat); |
839 | printk("Incompatible OOB or ECC data on \"%s\"\n", | 839 | printk("Incompatible OOB or ECC data on \"%s\"\n", |
840 | subdev[i]->name); | 840 | subdev[i]->name); |
@@ -849,15 +849,15 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c | |||
849 | concat->num_subdev = num_devs; | 849 | concat->num_subdev = num_devs; |
850 | concat->mtd.name = name; | 850 | concat->mtd.name = name; |
851 | 851 | ||
852 | concat->mtd.erase = concat_erase; | 852 | concat->mtd._erase = concat_erase; |
853 | concat->mtd.read = concat_read; | 853 | concat->mtd._read = concat_read; |
854 | concat->mtd.write = concat_write; | 854 | concat->mtd._write = concat_write; |
855 | concat->mtd.sync = concat_sync; | 855 | concat->mtd._sync = concat_sync; |
856 | concat->mtd.lock = concat_lock; | 856 | concat->mtd._lock = concat_lock; |
857 | concat->mtd.unlock = concat_unlock; | 857 | concat->mtd._unlock = concat_unlock; |
858 | concat->mtd.suspend = concat_suspend; | 858 | concat->mtd._suspend = concat_suspend; |
859 | concat->mtd.resume = concat_resume; | 859 | concat->mtd._resume = concat_resume; |
860 | concat->mtd.get_unmapped_area = concat_get_unmapped_area; | 860 | concat->mtd._get_unmapped_area = concat_get_unmapped_area; |
861 | 861 | ||
862 | /* | 862 | /* |
863 | * Combine the erase block size info of the subdevices: | 863 | * Combine the erase block size info of the subdevices: |
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index de96865b4f96..aafe0ee9c9f3 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c | |||
@@ -126,7 +126,7 @@ static int mtd_cls_resume(struct device *dev) | |||
126 | { | 126 | { |
127 | struct mtd_info *mtd = dev_get_drvdata(dev); | 127 | struct mtd_info *mtd = dev_get_drvdata(dev); |
128 | 128 | ||
129 | if (mtd && mtd->resume) | 129 | if (mtd && mtd->_resume) |
130 | mtd_resume(mtd); | 130 | mtd_resume(mtd); |
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |
@@ -610,8 +610,8 @@ int __get_mtd_device(struct mtd_info *mtd) | |||
610 | if (!try_module_get(mtd->owner)) | 610 | if (!try_module_get(mtd->owner)) |
611 | return -ENODEV; | 611 | return -ENODEV; |
612 | 612 | ||
613 | if (mtd->get_device) { | 613 | if (mtd->_get_device) { |
614 | err = mtd->get_device(mtd); | 614 | err = mtd->_get_device(mtd); |
615 | 615 | ||
616 | if (err) { | 616 | if (err) { |
617 | module_put(mtd->owner); | 617 | module_put(mtd->owner); |
@@ -675,8 +675,8 @@ void __put_mtd_device(struct mtd_info *mtd) | |||
675 | --mtd->usecount; | 675 | --mtd->usecount; |
676 | BUG_ON(mtd->usecount < 0); | 676 | BUG_ON(mtd->usecount < 0); |
677 | 677 | ||
678 | if (mtd->put_device) | 678 | if (mtd->_put_device) |
679 | mtd->put_device(mtd); | 679 | mtd->_put_device(mtd); |
680 | 680 | ||
681 | module_put(mtd->owner); | 681 | module_put(mtd->owner); |
682 | } | 682 | } |
@@ -729,9 +729,9 @@ int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, | |||
729 | unsigned long count, loff_t to, size_t *retlen) | 729 | unsigned long count, loff_t to, size_t *retlen) |
730 | { | 730 | { |
731 | *retlen = 0; | 731 | *retlen = 0; |
732 | if (!mtd->writev) | 732 | if (!mtd->_writev) |
733 | return default_mtd_writev(mtd, vecs, count, to, retlen); | 733 | return default_mtd_writev(mtd, vecs, count, to, retlen); |
734 | return mtd->writev(mtd, vecs, count, to, retlen); | 734 | return mtd->_writev(mtd, vecs, count, to, retlen); |
735 | } | 735 | } |
736 | EXPORT_SYMBOL_GPL(mtd_writev); | 736 | EXPORT_SYMBOL_GPL(mtd_writev); |
737 | 737 | ||
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 47d00f0bb36d..4f01079e357f 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c | |||
@@ -262,7 +262,7 @@ static int part_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
262 | 262 | ||
263 | void mtd_erase_callback(struct erase_info *instr) | 263 | void mtd_erase_callback(struct erase_info *instr) |
264 | { | 264 | { |
265 | if (instr->mtd->erase == part_erase) { | 265 | if (instr->mtd->_erase == part_erase) { |
266 | struct mtd_part *part = PART(instr->mtd); | 266 | struct mtd_part *part = PART(instr->mtd); |
267 | 267 | ||
268 | if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) | 268 | if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) |
@@ -410,54 +410,55 @@ static struct mtd_part *allocate_partition(struct mtd_info *master, | |||
410 | */ | 410 | */ |
411 | slave->mtd.dev.parent = master->dev.parent; | 411 | slave->mtd.dev.parent = master->dev.parent; |
412 | 412 | ||
413 | slave->mtd.read = part_read; | 413 | slave->mtd._read = part_read; |
414 | slave->mtd.write = part_write; | 414 | slave->mtd._write = part_write; |
415 | 415 | ||
416 | if (master->panic_write) | 416 | if (master->_panic_write) |
417 | slave->mtd.panic_write = part_panic_write; | 417 | slave->mtd._panic_write = part_panic_write; |
418 | 418 | ||
419 | if (master->point && master->unpoint) { | 419 | if (master->_point && master->_unpoint) { |
420 | slave->mtd.point = part_point; | 420 | slave->mtd._point = part_point; |
421 | slave->mtd.unpoint = part_unpoint; | 421 | slave->mtd._unpoint = part_unpoint; |
422 | } | 422 | } |
423 | 423 | ||
424 | if (master->get_unmapped_area) | 424 | if (master->_get_unmapped_area) |
425 | slave->mtd.get_unmapped_area = part_get_unmapped_area; | 425 | slave->mtd._get_unmapped_area = part_get_unmapped_area; |
426 | if (master->read_oob) | 426 | if (master->_read_oob) |
427 | slave->mtd.read_oob = part_read_oob; | 427 | slave->mtd._read_oob = part_read_oob; |
428 | if (master->write_oob) | 428 | if (master->_write_oob) |
429 | slave->mtd.write_oob = part_write_oob; | 429 | slave->mtd._write_oob = part_write_oob; |
430 | if (master->read_user_prot_reg) | 430 | if (master->_read_user_prot_reg) |
431 | slave->mtd.read_user_prot_reg = part_read_user_prot_reg; | 431 | slave->mtd._read_user_prot_reg = part_read_user_prot_reg; |
432 | if (master->read_fact_prot_reg) | 432 | if (master->_read_fact_prot_reg) |
433 | slave->mtd.read_fact_prot_reg = part_read_fact_prot_reg; | 433 | slave->mtd._read_fact_prot_reg = part_read_fact_prot_reg; |
434 | if (master->write_user_prot_reg) | 434 | if (master->_write_user_prot_reg) |
435 | slave->mtd.write_user_prot_reg = part_write_user_prot_reg; | 435 | slave->mtd._write_user_prot_reg = part_write_user_prot_reg; |
436 | if (master->lock_user_prot_reg) | 436 | if (master->_lock_user_prot_reg) |
437 | slave->mtd.lock_user_prot_reg = part_lock_user_prot_reg; | 437 | slave->mtd._lock_user_prot_reg = part_lock_user_prot_reg; |
438 | if (master->get_user_prot_info) | 438 | if (master->_get_user_prot_info) |
439 | slave->mtd.get_user_prot_info = part_get_user_prot_info; | 439 | slave->mtd._get_user_prot_info = part_get_user_prot_info; |
440 | if (master->get_fact_prot_info) | 440 | if (master->_get_fact_prot_info) |
441 | slave->mtd.get_fact_prot_info = part_get_fact_prot_info; | 441 | slave->mtd._get_fact_prot_info = part_get_fact_prot_info; |
442 | if (master->sync) | 442 | if (master->_sync) |
443 | slave->mtd.sync = part_sync; | 443 | slave->mtd._sync = part_sync; |
444 | if (!partno && !master->dev.class && master->suspend && master->resume) { | 444 | if (!partno && !master->dev.class && master->_suspend && |
445 | slave->mtd.suspend = part_suspend; | 445 | master->_resume) { |
446 | slave->mtd.resume = part_resume; | 446 | slave->mtd._suspend = part_suspend; |
447 | slave->mtd._resume = part_resume; | ||
447 | } | 448 | } |
448 | if (master->writev) | 449 | if (master->_writev) |
449 | slave->mtd.writev = part_writev; | 450 | slave->mtd._writev = part_writev; |
450 | if (master->lock) | 451 | if (master->_lock) |
451 | slave->mtd.lock = part_lock; | 452 | slave->mtd._lock = part_lock; |
452 | if (master->unlock) | 453 | if (master->_unlock) |
453 | slave->mtd.unlock = part_unlock; | 454 | slave->mtd._unlock = part_unlock; |
454 | if (master->is_locked) | 455 | if (master->_is_locked) |
455 | slave->mtd.is_locked = part_is_locked; | 456 | slave->mtd._is_locked = part_is_locked; |
456 | if (master->block_isbad) | 457 | if (master->_block_isbad) |
457 | slave->mtd.block_isbad = part_block_isbad; | 458 | slave->mtd._block_isbad = part_block_isbad; |
458 | if (master->block_markbad) | 459 | if (master->_block_markbad) |
459 | slave->mtd.block_markbad = part_block_markbad; | 460 | slave->mtd._block_markbad = part_block_markbad; |
460 | slave->mtd.erase = part_erase; | 461 | slave->mtd._erase = part_erase; |
461 | slave->master = master; | 462 | slave->master = master; |
462 | slave->offset = part->offset; | 463 | slave->offset = part->offset; |
463 | 464 | ||
@@ -549,7 +550,7 @@ static struct mtd_part *allocate_partition(struct mtd_info *master, | |||
549 | } | 550 | } |
550 | 551 | ||
551 | slave->mtd.ecclayout = master->ecclayout; | 552 | slave->mtd.ecclayout = master->ecclayout; |
552 | if (master->block_isbad) { | 553 | if (master->_block_isbad) { |
553 | uint64_t offs = 0; | 554 | uint64_t offs = 0; |
554 | 555 | ||
555 | while (offs < slave->mtd.size) { | 556 | while (offs < slave->mtd.size) { |
diff --git a/drivers/mtd/nand/alauda.c b/drivers/mtd/nand/alauda.c index 6a5ff64a139e..ac38f73fde3b 100644 --- a/drivers/mtd/nand/alauda.c +++ b/drivers/mtd/nand/alauda.c | |||
@@ -585,10 +585,10 @@ static int alauda_init_media(struct alauda *al) | |||
585 | mtd->writesize = 1<<card->pageshift; | 585 | mtd->writesize = 1<<card->pageshift; |
586 | mtd->type = MTD_NANDFLASH; | 586 | mtd->type = MTD_NANDFLASH; |
587 | mtd->flags = MTD_CAP_NANDFLASH; | 587 | mtd->flags = MTD_CAP_NANDFLASH; |
588 | mtd->read = alauda_read; | 588 | mtd->_read = alauda_read; |
589 | mtd->write = alauda_write; | 589 | mtd->_write = alauda_write; |
590 | mtd->erase = alauda_erase; | 590 | mtd->_erase = alauda_erase; |
591 | mtd->block_isbad = alauda_isbad; | 591 | mtd->_block_isbad = alauda_isbad; |
592 | mtd->priv = al; | 592 | mtd->priv = al; |
593 | mtd->owner = THIS_MODULE; | 593 | mtd->owner = THIS_MODULE; |
594 | 594 | ||
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index b90206613108..05f8243ed1d3 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -3483,21 +3483,21 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3483 | mtd->type = MTD_NANDFLASH; | 3483 | mtd->type = MTD_NANDFLASH; |
3484 | mtd->flags = (chip->options & NAND_ROM) ? MTD_CAP_ROM : | 3484 | mtd->flags = (chip->options & NAND_ROM) ? MTD_CAP_ROM : |
3485 | MTD_CAP_NANDFLASH; | 3485 | MTD_CAP_NANDFLASH; |
3486 | mtd->erase = nand_erase; | 3486 | mtd->_erase = nand_erase; |
3487 | mtd->point = NULL; | 3487 | mtd->_point = NULL; |
3488 | mtd->unpoint = NULL; | 3488 | mtd->_unpoint = NULL; |
3489 | mtd->read = nand_read; | 3489 | mtd->_read = nand_read; |
3490 | mtd->write = nand_write; | 3490 | mtd->_write = nand_write; |
3491 | mtd->panic_write = panic_nand_write; | 3491 | mtd->_panic_write = panic_nand_write; |
3492 | mtd->read_oob = nand_read_oob; | 3492 | mtd->_read_oob = nand_read_oob; |
3493 | mtd->write_oob = nand_write_oob; | 3493 | mtd->_write_oob = nand_write_oob; |
3494 | mtd->sync = nand_sync; | 3494 | mtd->_sync = nand_sync; |
3495 | mtd->lock = NULL; | 3495 | mtd->_lock = NULL; |
3496 | mtd->unlock = NULL; | 3496 | mtd->_unlock = NULL; |
3497 | mtd->suspend = nand_suspend; | 3497 | mtd->_suspend = nand_suspend; |
3498 | mtd->resume = nand_resume; | 3498 | mtd->_resume = nand_resume; |
3499 | mtd->block_isbad = nand_block_isbad; | 3499 | mtd->_block_isbad = nand_block_isbad; |
3500 | mtd->block_markbad = nand_block_markbad; | 3500 | mtd->_block_markbad = nand_block_markbad; |
3501 | mtd->writebufsize = mtd->writesize; | 3501 | mtd->writebufsize = mtd->writesize; |
3502 | 3502 | ||
3503 | /* propagate ecc.layout to mtd_info */ | 3503 | /* propagate ecc.layout to mtd_info */ |
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index a061bc163da2..914c49bdf2b6 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c | |||
@@ -4107,29 +4107,29 @@ int onenand_scan(struct mtd_info *mtd, int maxchips) | |||
4107 | /* Fill in remaining MTD driver data */ | 4107 | /* Fill in remaining MTD driver data */ |
4108 | mtd->type = ONENAND_IS_MLC(this) ? MTD_MLCNANDFLASH : MTD_NANDFLASH; | 4108 | mtd->type = ONENAND_IS_MLC(this) ? MTD_MLCNANDFLASH : MTD_NANDFLASH; |
4109 | mtd->flags = MTD_CAP_NANDFLASH; | 4109 | mtd->flags = MTD_CAP_NANDFLASH; |
4110 | mtd->erase = onenand_erase; | 4110 | mtd->_erase = onenand_erase; |
4111 | mtd->point = NULL; | 4111 | mtd->_point = NULL; |
4112 | mtd->unpoint = NULL; | 4112 | mtd->_unpoint = NULL; |
4113 | mtd->read = onenand_read; | 4113 | mtd->_read = onenand_read; |
4114 | mtd->write = onenand_write; | 4114 | mtd->_write = onenand_write; |
4115 | mtd->read_oob = onenand_read_oob; | 4115 | mtd->_read_oob = onenand_read_oob; |
4116 | mtd->write_oob = onenand_write_oob; | 4116 | mtd->_write_oob = onenand_write_oob; |
4117 | mtd->panic_write = onenand_panic_write; | 4117 | mtd->_panic_write = onenand_panic_write; |
4118 | #ifdef CONFIG_MTD_ONENAND_OTP | 4118 | #ifdef CONFIG_MTD_ONENAND_OTP |
4119 | mtd->get_fact_prot_info = onenand_get_fact_prot_info; | 4119 | mtd->_get_fact_prot_info = onenand_get_fact_prot_info; |
4120 | mtd->read_fact_prot_reg = onenand_read_fact_prot_reg; | 4120 | mtd->_read_fact_prot_reg = onenand_read_fact_prot_reg; |
4121 | mtd->get_user_prot_info = onenand_get_user_prot_info; | 4121 | mtd->_get_user_prot_info = onenand_get_user_prot_info; |
4122 | mtd->read_user_prot_reg = onenand_read_user_prot_reg; | 4122 | mtd->_read_user_prot_reg = onenand_read_user_prot_reg; |
4123 | mtd->write_user_prot_reg = onenand_write_user_prot_reg; | 4123 | mtd->_write_user_prot_reg = onenand_write_user_prot_reg; |
4124 | mtd->lock_user_prot_reg = onenand_lock_user_prot_reg; | 4124 | mtd->_lock_user_prot_reg = onenand_lock_user_prot_reg; |
4125 | #endif | 4125 | #endif |
4126 | mtd->sync = onenand_sync; | 4126 | mtd->_sync = onenand_sync; |
4127 | mtd->lock = onenand_lock; | 4127 | mtd->_lock = onenand_lock; |
4128 | mtd->unlock = onenand_unlock; | 4128 | mtd->_unlock = onenand_unlock; |
4129 | mtd->suspend = onenand_suspend; | 4129 | mtd->_suspend = onenand_suspend; |
4130 | mtd->resume = onenand_resume; | 4130 | mtd->_resume = onenand_resume; |
4131 | mtd->block_isbad = onenand_block_isbad; | 4131 | mtd->_block_isbad = onenand_block_isbad; |
4132 | mtd->block_markbad = onenand_block_markbad; | 4132 | mtd->_block_markbad = onenand_block_markbad; |
4133 | mtd->owner = THIS_MODULE; | 4133 | mtd->owner = THIS_MODULE; |
4134 | mtd->writebufsize = mtd->writesize; | 4134 | mtd->writebufsize = mtd->writesize; |
4135 | 4135 | ||
diff --git a/drivers/mtd/ubi/gluebi.c b/drivers/mtd/ubi/gluebi.c index 941bc3c05d6e..0101dce90c45 100644 --- a/drivers/mtd/ubi/gluebi.c +++ b/drivers/mtd/ubi/gluebi.c | |||
@@ -340,11 +340,11 @@ static int gluebi_create(struct ubi_device_info *di, | |||
340 | mtd->owner = THIS_MODULE; | 340 | mtd->owner = THIS_MODULE; |
341 | mtd->writesize = di->min_io_size; | 341 | mtd->writesize = di->min_io_size; |
342 | mtd->erasesize = vi->usable_leb_size; | 342 | mtd->erasesize = vi->usable_leb_size; |
343 | mtd->read = gluebi_read; | 343 | mtd->_read = gluebi_read; |
344 | mtd->write = gluebi_write; | 344 | mtd->_write = gluebi_write; |
345 | mtd->erase = gluebi_erase; | 345 | mtd->_erase = gluebi_erase; |
346 | mtd->get_device = gluebi_get_device; | 346 | mtd->_get_device = gluebi_get_device; |
347 | mtd->put_device = gluebi_put_device; | 347 | mtd->_put_device = gluebi_put_device; |
348 | 348 | ||
349 | /* | 349 | /* |
350 | * In case of dynamic a volume, MTD device size is just volume size. In | 350 | * In case of dynamic a volume, MTD device size is just volume size. In |
diff --git a/drivers/net/ethernet/sfc/mtd.c b/drivers/net/ethernet/sfc/mtd.c index bc9dcd6b30d7..6622eca09cbe 100644 --- a/drivers/net/ethernet/sfc/mtd.c +++ b/drivers/net/ethernet/sfc/mtd.c | |||
@@ -263,10 +263,10 @@ static int efx_mtd_probe_device(struct efx_nic *efx, struct efx_mtd *efx_mtd) | |||
263 | part->mtd.owner = THIS_MODULE; | 263 | part->mtd.owner = THIS_MODULE; |
264 | part->mtd.priv = efx_mtd; | 264 | part->mtd.priv = efx_mtd; |
265 | part->mtd.name = part->name; | 265 | part->mtd.name = part->name; |
266 | part->mtd.erase = efx_mtd_erase; | 266 | part->mtd._erase = efx_mtd_erase; |
267 | part->mtd.read = efx_mtd->ops->read; | 267 | part->mtd._read = efx_mtd->ops->read; |
268 | part->mtd.write = efx_mtd->ops->write; | 268 | part->mtd._write = efx_mtd->ops->write; |
269 | part->mtd.sync = efx_mtd_sync; | 269 | part->mtd._sync = efx_mtd_sync; |
270 | 270 | ||
271 | if (mtd_device_register(&part->mtd, NULL, 0)) | 271 | if (mtd_device_register(&part->mtd, NULL, 0)) |
272 | goto fail; | 272 | goto fail; |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index d43dc25af82e..e2e545616b2a 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -174,52 +174,52 @@ struct mtd_info { | |||
174 | * Do not call via these pointers, use corresponding mtd_*() | 174 | * Do not call via these pointers, use corresponding mtd_*() |
175 | * wrappers instead. | 175 | * wrappers instead. |
176 | */ | 176 | */ |
177 | int (*erase) (struct mtd_info *mtd, struct erase_info *instr); | 177 | int (*_erase) (struct mtd_info *mtd, struct erase_info *instr); |
178 | int (*point) (struct mtd_info *mtd, loff_t from, size_t len, | 178 | int (*_point) (struct mtd_info *mtd, loff_t from, size_t len, |
179 | size_t *retlen, void **virt, resource_size_t *phys); | 179 | size_t *retlen, void **virt, resource_size_t *phys); |
180 | void (*unpoint) (struct mtd_info *mtd, loff_t from, size_t len); | 180 | void (*_unpoint) (struct mtd_info *mtd, loff_t from, size_t len); |
181 | unsigned long (*get_unmapped_area) (struct mtd_info *mtd, | 181 | unsigned long (*_get_unmapped_area) (struct mtd_info *mtd, |
182 | unsigned long len, | 182 | unsigned long len, |
183 | unsigned long offset, | 183 | unsigned long offset, |
184 | unsigned long flags); | 184 | unsigned long flags); |
185 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, | 185 | int (*_read) (struct mtd_info *mtd, loff_t from, size_t len, |
186 | size_t *retlen, u_char *buf); | 186 | size_t *retlen, u_char *buf); |
187 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, | 187 | int (*_write) (struct mtd_info *mtd, loff_t to, size_t len, |
188 | size_t *retlen, const u_char *buf); | 188 | size_t *retlen, const u_char *buf); |
189 | int (*panic_write) (struct mtd_info *mtd, loff_t to, size_t len, | 189 | int (*_panic_write) (struct mtd_info *mtd, loff_t to, size_t len, |
190 | size_t *retlen, const u_char *buf); | 190 | size_t *retlen, const u_char *buf); |
191 | int (*read_oob) (struct mtd_info *mtd, loff_t from, | 191 | int (*_read_oob) (struct mtd_info *mtd, loff_t from, |
192 | struct mtd_oob_ops *ops); | ||
193 | int (*write_oob) (struct mtd_info *mtd, loff_t to, | ||
194 | struct mtd_oob_ops *ops); | 192 | struct mtd_oob_ops *ops); |
195 | int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, | 193 | int (*_write_oob) (struct mtd_info *mtd, loff_t to, |
196 | size_t len); | 194 | struct mtd_oob_ops *ops); |
197 | int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, | 195 | int (*_get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, |
198 | size_t len, size_t *retlen, u_char *buf); | 196 | size_t len); |
199 | int (*get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, | 197 | int (*_read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, |
200 | size_t len); | 198 | size_t len, size_t *retlen, u_char *buf); |
201 | int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, | 199 | int (*_get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, |
202 | size_t len, size_t *retlen, u_char *buf); | 200 | size_t len); |
203 | int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t to, size_t len, | 201 | int (*_read_user_prot_reg) (struct mtd_info *mtd, loff_t from, |
204 | size_t *retlen, u_char *buf); | 202 | size_t len, size_t *retlen, u_char *buf); |
205 | int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, | 203 | int (*_write_user_prot_reg) (struct mtd_info *mtd, loff_t to, |
206 | size_t len); | 204 | size_t len, size_t *retlen, u_char *buf); |
207 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, | 205 | int (*_lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, |
206 | size_t len); | ||
207 | int (*_writev) (struct mtd_info *mtd, const struct kvec *vecs, | ||
208 | unsigned long count, loff_t to, size_t *retlen); | 208 | unsigned long count, loff_t to, size_t *retlen); |
209 | void (*sync) (struct mtd_info *mtd); | 209 | void (*_sync) (struct mtd_info *mtd); |
210 | int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 210 | int (*_lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
211 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 211 | int (*_unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
212 | int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 212 | int (*_is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
213 | int (*block_isbad) (struct mtd_info *mtd, loff_t ofs); | 213 | int (*_block_isbad) (struct mtd_info *mtd, loff_t ofs); |
214 | int (*block_markbad) (struct mtd_info *mtd, loff_t ofs); | 214 | int (*_block_markbad) (struct mtd_info *mtd, loff_t ofs); |
215 | int (*suspend) (struct mtd_info *mtd); | 215 | int (*_suspend) (struct mtd_info *mtd); |
216 | void (*resume) (struct mtd_info *mtd); | 216 | void (*_resume) (struct mtd_info *mtd); |
217 | /* | 217 | /* |
218 | * If the driver is something smart, like UBI, it may need to maintain | 218 | * If the driver is something smart, like UBI, it may need to maintain |
219 | * its own reference counting. The below functions are only for driver. | 219 | * its own reference counting. The below functions are only for driver. |
220 | */ | 220 | */ |
221 | int (*get_device) (struct mtd_info *mtd); | 221 | int (*_get_device) (struct mtd_info *mtd); |
222 | void (*put_device) (struct mtd_info *mtd); | 222 | void (*_put_device) (struct mtd_info *mtd); |
223 | 223 | ||
224 | /* Backing device capabilities for this device | 224 | /* Backing device capabilities for this device |
225 | * - provides mmap capabilities | 225 | * - provides mmap capabilities |
@@ -249,7 +249,7 @@ struct mtd_info { | |||
249 | */ | 249 | */ |
250 | static inline int mtd_erase(struct mtd_info *mtd, struct erase_info *instr) | 250 | static inline int mtd_erase(struct mtd_info *mtd, struct erase_info *instr) |
251 | { | 251 | { |
252 | return mtd->erase(mtd, instr); | 252 | return mtd->_erase(mtd, instr); |
253 | } | 253 | } |
254 | 254 | ||
255 | /* | 255 | /* |
@@ -259,15 +259,15 @@ static inline int mtd_point(struct mtd_info *mtd, loff_t from, size_t len, | |||
259 | size_t *retlen, void **virt, resource_size_t *phys) | 259 | size_t *retlen, void **virt, resource_size_t *phys) |
260 | { | 260 | { |
261 | *retlen = 0; | 261 | *retlen = 0; |
262 | if (!mtd->point) | 262 | if (!mtd->_point) |
263 | return -EOPNOTSUPP; | 263 | return -EOPNOTSUPP; |
264 | return mtd->point(mtd, from, len, retlen, virt, phys); | 264 | return mtd->_point(mtd, from, len, retlen, virt, phys); |
265 | } | 265 | } |
266 | 266 | ||
267 | /* We probably shouldn't allow XIP if the unpoint isn't a NULL */ | 267 | /* We probably shouldn't allow XIP if the unpoint isn't a NULL */ |
268 | static inline void mtd_unpoint(struct mtd_info *mtd, loff_t from, size_t len) | 268 | static inline void mtd_unpoint(struct mtd_info *mtd, loff_t from, size_t len) |
269 | { | 269 | { |
270 | return mtd->unpoint(mtd, from, len); | 270 | return mtd->_unpoint(mtd, from, len); |
271 | } | 271 | } |
272 | 272 | ||
273 | /* | 273 | /* |
@@ -280,24 +280,24 @@ static inline unsigned long mtd_get_unmapped_area(struct mtd_info *mtd, | |||
280 | unsigned long offset, | 280 | unsigned long offset, |
281 | unsigned long flags) | 281 | unsigned long flags) |
282 | { | 282 | { |
283 | if (!mtd->get_unmapped_area) | 283 | if (!mtd->_get_unmapped_area) |
284 | return -EOPNOTSUPP; | 284 | return -EOPNOTSUPP; |
285 | return mtd->get_unmapped_area(mtd, len, offset, flags); | 285 | return mtd->_get_unmapped_area(mtd, len, offset, flags); |
286 | } | 286 | } |
287 | 287 | ||
288 | static inline int mtd_read(struct mtd_info *mtd, loff_t from, size_t len, | 288 | static inline int mtd_read(struct mtd_info *mtd, loff_t from, size_t len, |
289 | size_t *retlen, u_char *buf) | 289 | size_t *retlen, u_char *buf) |
290 | { | 290 | { |
291 | return mtd->read(mtd, from, len, retlen, buf); | 291 | return mtd->_read(mtd, from, len, retlen, buf); |
292 | } | 292 | } |
293 | 293 | ||
294 | static inline int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, | 294 | static inline int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, |
295 | size_t *retlen, const u_char *buf) | 295 | size_t *retlen, const u_char *buf) |
296 | { | 296 | { |
297 | *retlen = 0; | 297 | *retlen = 0; |
298 | if (!mtd->write) | 298 | if (!mtd->_write) |
299 | return -EROFS; | 299 | return -EROFS; |
300 | return mtd->write(mtd, to, len, retlen, buf); | 300 | return mtd->_write(mtd, to, len, retlen, buf); |
301 | } | 301 | } |
302 | 302 | ||
303 | /* | 303 | /* |
@@ -311,27 +311,27 @@ static inline int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
311 | size_t *retlen, const u_char *buf) | 311 | size_t *retlen, const u_char *buf) |
312 | { | 312 | { |
313 | *retlen = 0; | 313 | *retlen = 0; |
314 | if (!mtd->panic_write) | 314 | if (!mtd->_panic_write) |
315 | return -EOPNOTSUPP; | 315 | return -EOPNOTSUPP; |
316 | return mtd->panic_write(mtd, to, len, retlen, buf); | 316 | return mtd->_panic_write(mtd, to, len, retlen, buf); |
317 | } | 317 | } |
318 | 318 | ||
319 | static inline int mtd_read_oob(struct mtd_info *mtd, loff_t from, | 319 | static inline int mtd_read_oob(struct mtd_info *mtd, loff_t from, |
320 | struct mtd_oob_ops *ops) | 320 | struct mtd_oob_ops *ops) |
321 | { | 321 | { |
322 | ops->retlen = ops->oobretlen = 0; | 322 | ops->retlen = ops->oobretlen = 0; |
323 | if (!mtd->read_oob) | 323 | if (!mtd->_read_oob) |
324 | return -EOPNOTSUPP; | 324 | return -EOPNOTSUPP; |
325 | return mtd->read_oob(mtd, from, ops); | 325 | return mtd->_read_oob(mtd, from, ops); |
326 | } | 326 | } |
327 | 327 | ||
328 | static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, | 328 | static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, |
329 | struct mtd_oob_ops *ops) | 329 | struct mtd_oob_ops *ops) |
330 | { | 330 | { |
331 | ops->retlen = ops->oobretlen = 0; | 331 | ops->retlen = ops->oobretlen = 0; |
332 | if (!mtd->write_oob) | 332 | if (!mtd->_write_oob) |
333 | return -EOPNOTSUPP; | 333 | return -EOPNOTSUPP; |
334 | return mtd->write_oob(mtd, to, ops); | 334 | return mtd->_write_oob(mtd, to, ops); |
335 | } | 335 | } |
336 | 336 | ||
337 | /* | 337 | /* |
@@ -342,9 +342,9 @@ static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, | |||
342 | static inline int mtd_get_fact_prot_info(struct mtd_info *mtd, | 342 | static inline int mtd_get_fact_prot_info(struct mtd_info *mtd, |
343 | struct otp_info *buf, size_t len) | 343 | struct otp_info *buf, size_t len) |
344 | { | 344 | { |
345 | if (!mtd->get_fact_prot_info) | 345 | if (!mtd->_get_fact_prot_info) |
346 | return -EOPNOTSUPP; | 346 | return -EOPNOTSUPP; |
347 | return mtd->get_fact_prot_info(mtd, buf, len); | 347 | return mtd->_get_fact_prot_info(mtd, buf, len); |
348 | } | 348 | } |
349 | 349 | ||
350 | static inline int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, | 350 | static inline int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, |
@@ -352,18 +352,18 @@ static inline int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, | |||
352 | u_char *buf) | 352 | u_char *buf) |
353 | { | 353 | { |
354 | *retlen = 0; | 354 | *retlen = 0; |
355 | if (!mtd->read_fact_prot_reg) | 355 | if (!mtd->_read_fact_prot_reg) |
356 | return -EOPNOTSUPP; | 356 | return -EOPNOTSUPP; |
357 | return mtd->read_fact_prot_reg(mtd, from, len, retlen, buf); | 357 | return mtd->_read_fact_prot_reg(mtd, from, len, retlen, buf); |
358 | } | 358 | } |
359 | 359 | ||
360 | static inline int mtd_get_user_prot_info(struct mtd_info *mtd, | 360 | static inline int mtd_get_user_prot_info(struct mtd_info *mtd, |
361 | struct otp_info *buf, | 361 | struct otp_info *buf, |
362 | size_t len) | 362 | size_t len) |
363 | { | 363 | { |
364 | if (!mtd->get_user_prot_info) | 364 | if (!mtd->_get_user_prot_info) |
365 | return -EOPNOTSUPP; | 365 | return -EOPNOTSUPP; |
366 | return mtd->get_user_prot_info(mtd, buf, len); | 366 | return mtd->_get_user_prot_info(mtd, buf, len); |
367 | } | 367 | } |
368 | 368 | ||
369 | static inline int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, | 369 | static inline int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, |
@@ -371,9 +371,9 @@ static inline int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, | |||
371 | u_char *buf) | 371 | u_char *buf) |
372 | { | 372 | { |
373 | *retlen = 0; | 373 | *retlen = 0; |
374 | if (!mtd->read_user_prot_reg) | 374 | if (!mtd->_read_user_prot_reg) |
375 | return -EOPNOTSUPP; | 375 | return -EOPNOTSUPP; |
376 | return mtd->read_user_prot_reg(mtd, from, len, retlen, buf); | 376 | return mtd->_read_user_prot_reg(mtd, from, len, retlen, buf); |
377 | } | 377 | } |
378 | 378 | ||
379 | static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, | 379 | static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, |
@@ -381,17 +381,17 @@ static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, | |||
381 | u_char *buf) | 381 | u_char *buf) |
382 | { | 382 | { |
383 | *retlen = 0; | 383 | *retlen = 0; |
384 | if (!mtd->write_user_prot_reg) | 384 | if (!mtd->_write_user_prot_reg) |
385 | return -EOPNOTSUPP; | 385 | return -EOPNOTSUPP; |
386 | return mtd->write_user_prot_reg(mtd, to, len, retlen, buf); | 386 | return mtd->_write_user_prot_reg(mtd, to, len, retlen, buf); |
387 | } | 387 | } |
388 | 388 | ||
389 | static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, | 389 | static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, |
390 | size_t len) | 390 | size_t len) |
391 | { | 391 | { |
392 | if (!mtd->lock_user_prot_reg) | 392 | if (!mtd->_lock_user_prot_reg) |
393 | return -EOPNOTSUPP; | 393 | return -EOPNOTSUPP; |
394 | return mtd->lock_user_prot_reg(mtd, from, len); | 394 | return mtd->_lock_user_prot_reg(mtd, from, len); |
395 | } | 395 | } |
396 | 396 | ||
397 | int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, | 397 | int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, |
@@ -399,55 +399,55 @@ int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, | |||
399 | 399 | ||
400 | static inline void mtd_sync(struct mtd_info *mtd) | 400 | static inline void mtd_sync(struct mtd_info *mtd) |
401 | { | 401 | { |
402 | if (mtd->sync) | 402 | if (mtd->_sync) |
403 | mtd->sync(mtd); | 403 | mtd->_sync(mtd); |
404 | } | 404 | } |
405 | 405 | ||
406 | /* Chip-supported device locking */ | 406 | /* Chip-supported device locking */ |
407 | static inline int mtd_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) | 407 | static inline int mtd_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) |
408 | { | 408 | { |
409 | if (!mtd->lock) | 409 | if (!mtd->_lock) |
410 | return -EOPNOTSUPP; | 410 | return -EOPNOTSUPP; |
411 | return mtd->lock(mtd, ofs, len); | 411 | return mtd->_lock(mtd, ofs, len); |
412 | } | 412 | } |
413 | 413 | ||
414 | static inline int mtd_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) | 414 | static inline int mtd_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) |
415 | { | 415 | { |
416 | if (!mtd->unlock) | 416 | if (!mtd->_unlock) |
417 | return -EOPNOTSUPP; | 417 | return -EOPNOTSUPP; |
418 | return mtd->unlock(mtd, ofs, len); | 418 | return mtd->_unlock(mtd, ofs, len); |
419 | } | 419 | } |
420 | 420 | ||
421 | static inline int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) | 421 | static inline int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) |
422 | { | 422 | { |
423 | if (!mtd->is_locked) | 423 | if (!mtd->_is_locked) |
424 | return -EOPNOTSUPP; | 424 | return -EOPNOTSUPP; |
425 | return mtd->is_locked(mtd, ofs, len); | 425 | return mtd->_is_locked(mtd, ofs, len); |
426 | } | 426 | } |
427 | 427 | ||
428 | static inline int mtd_suspend(struct mtd_info *mtd) | 428 | static inline int mtd_suspend(struct mtd_info *mtd) |
429 | { | 429 | { |
430 | return mtd->suspend ? mtd->suspend(mtd) : 0; | 430 | return mtd->_suspend ? mtd->_suspend(mtd) : 0; |
431 | } | 431 | } |
432 | 432 | ||
433 | static inline void mtd_resume(struct mtd_info *mtd) | 433 | static inline void mtd_resume(struct mtd_info *mtd) |
434 | { | 434 | { |
435 | if (mtd->resume) | 435 | if (mtd->_resume) |
436 | mtd->resume(mtd); | 436 | mtd->_resume(mtd); |
437 | } | 437 | } |
438 | 438 | ||
439 | static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs) | 439 | static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs) |
440 | { | 440 | { |
441 | if (!mtd->block_isbad) | 441 | if (!mtd->_block_isbad) |
442 | return 0; | 442 | return 0; |
443 | return mtd->block_isbad(mtd, ofs); | 443 | return mtd->_block_isbad(mtd, ofs); |
444 | } | 444 | } |
445 | 445 | ||
446 | static inline int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs) | 446 | static inline int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs) |
447 | { | 447 | { |
448 | if (!mtd->block_markbad) | 448 | if (!mtd->_block_markbad) |
449 | return -EOPNOTSUPP; | 449 | return -EOPNOTSUPP; |
450 | return mtd->block_markbad(mtd, ofs); | 450 | return mtd->_block_markbad(mtd, ofs); |
451 | } | 451 | } |
452 | 452 | ||
453 | static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) | 453 | static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) |
@@ -482,12 +482,12 @@ static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd) | |||
482 | 482 | ||
483 | static inline int mtd_has_oob(const struct mtd_info *mtd) | 483 | static inline int mtd_has_oob(const struct mtd_info *mtd) |
484 | { | 484 | { |
485 | return mtd->read_oob && mtd->write_oob; | 485 | return mtd->_read_oob && mtd->_write_oob; |
486 | } | 486 | } |
487 | 487 | ||
488 | static inline int mtd_can_have_bb(const struct mtd_info *mtd) | 488 | static inline int mtd_can_have_bb(const struct mtd_info *mtd) |
489 | { | 489 | { |
490 | return !!mtd->block_isbad; | 490 | return !!mtd->_block_isbad; |
491 | } | 491 | } |
492 | 492 | ||
493 | /* Kernel-side ioctl definitions */ | 493 | /* Kernel-side ioctl definitions */ |