aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-01-30 07:58:32 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 19:20:01 -0400
commit3c3c10bba1e4ccb75b41442e45c1a072f6cded19 (patch)
tree5c929e46cd0b6fcf8a42db7637cf45dbf69fe126 /drivers/mtd/devices
parenta6c22850d20273896e7c8ee996730ccf2ba60a22 (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/devices')
-rw-r--r--drivers/mtd/devices/block2mtd.c10
-rw-r--r--drivers/mtd/devices/doc2000.c10
-rw-r--r--drivers/mtd/devices/doc2001.c10
-rw-r--r--drivers/mtd/devices/doc2001plus.c10
-rw-r--r--drivers/mtd/devices/docg3.c12
-rw-r--r--drivers/mtd/devices/lart.c6
-rw-r--r--drivers/mtd/devices/m25p80.c8
-rw-r--r--drivers/mtd/devices/ms02-nv.c4
-rw-r--r--drivers/mtd/devices/mtd_dataflash.c16
-rw-r--r--drivers/mtd/devices/mtdram.c12
-rw-r--r--drivers/mtd/devices/phram.c10
-rw-r--r--drivers/mtd/devices/pmc551.c10
-rw-r--r--drivers/mtd/devices/slram.c10
-rw-r--r--drivers/mtd/devices/spear_smi.c6
-rw-r--r--drivers/mtd/devices/sst25l.c6
15 files changed, 70 insertions, 70 deletions
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
612static char *otp_setup(struct mtd_info *device, char revision) 612static 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);