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 /drivers/mtd/mtdpart.c | |
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>
Diffstat (limited to 'drivers/mtd/mtdpart.c')
-rw-r--r-- | drivers/mtd/mtdpart.c | 91 |
1 files changed, 46 insertions, 45 deletions
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) { |