aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>2008-08-29 06:59:50 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-09-01 16:37:51 -0400
commit7dad482ed0648a40e403d1ed44e0ea92248632f1 (patch)
tree609b0663fa6d240b19aaed3bc89ce598fff83513
parent80ebf20f34c30760cfba7b5e0a418241181d2cd9 (diff)
[MTD] [NAND] pxa3xx_nand: added some 'const' annotations to the exported API
This patch marks some attributes as 'const' which are set only once and never be modified by the driver. There are some changes in parameter list and variable declarations too which mark them as 'const'. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa3xx_nand.h8
-rw-r--r--drivers/mtd/nand/pxa3xx_nand.c10
2 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx_nand.h b/arch/arm/mach-pxa/include/mach/pxa3xx_nand.h
index 6ac9aea0b0b5..cfcb2e21aeeb 100644
--- a/arch/arm/mach-pxa/include/mach/pxa3xx_nand.h
+++ b/arch/arm/mach-pxa/include/mach/pxa3xx_nand.h
@@ -30,8 +30,8 @@ struct pxa3xx_nand_cmdset {
30}; 30};
31 31
32struct pxa3xx_nand_flash { 32struct pxa3xx_nand_flash {
33 struct pxa3xx_nand_timing *timing; /* NAND Flash timing */ 33 const struct pxa3xx_nand_timing *timing; /* NAND Flash timing */
34 struct pxa3xx_nand_cmdset *cmdset; 34 const struct pxa3xx_nand_cmdset *cmdset;
35 35
36 uint32_t page_per_block;/* Pages per block (PG_PER_BLK) */ 36 uint32_t page_per_block;/* Pages per block (PG_PER_BLK) */
37 uint32_t page_size; /* Page size in bytes (PAGE_SZ) */ 37 uint32_t page_size; /* Page size in bytes (PAGE_SZ) */
@@ -56,8 +56,8 @@ struct pxa3xx_nand_platform_data {
56 */ 56 */
57 int enable_arbiter; 57 int enable_arbiter;
58 58
59 struct mtd_partition *parts; 59 const struct mtd_partition *parts;
60 unsigned int nr_parts; 60 unsigned int nr_parts;
61 61
62 struct pxa3xx_nand_flash * const flash; 62 struct pxa3xx_nand_flash * const flash;
63 size_t num_flash; 63 size_t num_flash;
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index e492804b3d98..af174054656e 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -293,7 +293,7 @@ static struct pxa3xx_nand_flash *builtin_flash_types[] = {
293#define ns2cycle(ns, clk) (int)(((ns) * (clk / 1000000) / 1000) + 1) 293#define ns2cycle(ns, clk) (int)(((ns) * (clk / 1000000) / 1000) + 1)
294 294
295static void pxa3xx_nand_set_timing(struct pxa3xx_nand_info *info, 295static void pxa3xx_nand_set_timing(struct pxa3xx_nand_info *info,
296 struct pxa3xx_nand_timing *t) 296 const struct pxa3xx_nand_timing *t)
297{ 297{
298 unsigned long nand_clk = clk_get_rate(info->clk); 298 unsigned long nand_clk = clk_get_rate(info->clk);
299 uint32_t ndtr0, ndtr1; 299 uint32_t ndtr0, ndtr1;
@@ -336,7 +336,7 @@ static int prepare_read_prog_cmd(struct pxa3xx_nand_info *info,
336 uint16_t cmd, int column, int page_addr) 336 uint16_t cmd, int column, int page_addr)
337{ 337{
338 struct pxa3xx_nand_flash *f = info->flash_info; 338 struct pxa3xx_nand_flash *f = info->flash_info;
339 struct pxa3xx_nand_cmdset *cmdset = f->cmdset; 339 const struct pxa3xx_nand_cmdset *cmdset = f->cmdset;
340 340
341 /* calculate data size */ 341 /* calculate data size */
342 switch (f->page_size) { 342 switch (f->page_size) {
@@ -387,7 +387,7 @@ static int prepare_erase_cmd(struct pxa3xx_nand_info *info,
387 387
388static int prepare_other_cmd(struct pxa3xx_nand_info *info, uint16_t cmd) 388static int prepare_other_cmd(struct pxa3xx_nand_info *info, uint16_t cmd)
389{ 389{
390 struct pxa3xx_nand_cmdset *cmdset = info->flash_info->cmdset; 390 const struct pxa3xx_nand_cmdset *cmdset = info->flash_info->cmdset;
391 391
392 info->ndcb0 = cmd | ((cmd & 0xff00) ? NDCB0_DBC : 0); 392 info->ndcb0 = cmd | ((cmd & 0xff00) ? NDCB0_DBC : 0);
393 info->ndcb1 = 0; 393 info->ndcb1 = 0;
@@ -623,7 +623,7 @@ static void pxa3xx_nand_cmdfunc(struct mtd_info *mtd, unsigned command,
623{ 623{
624 struct pxa3xx_nand_info *info = mtd->priv; 624 struct pxa3xx_nand_info *info = mtd->priv;
625 struct pxa3xx_nand_flash *flash_info = info->flash_info; 625 struct pxa3xx_nand_flash *flash_info = info->flash_info;
626 struct pxa3xx_nand_cmdset *cmdset = flash_info->cmdset; 626 const struct pxa3xx_nand_cmdset *cmdset = flash_info->cmdset;
627 int ret; 627 int ret;
628 628
629 info->use_dma = (use_dma) ? 1 : 0; 629 info->use_dma = (use_dma) ? 1 : 0;
@@ -843,7 +843,7 @@ static int pxa3xx_nand_ecc_correct(struct mtd_info *mtd,
843static int __readid(struct pxa3xx_nand_info *info, uint32_t *id) 843static int __readid(struct pxa3xx_nand_info *info, uint32_t *id)
844{ 844{
845 struct pxa3xx_nand_flash *f = info->flash_info; 845 struct pxa3xx_nand_flash *f = info->flash_info;
846 struct pxa3xx_nand_cmdset *cmdset = f->cmdset; 846 const struct pxa3xx_nand_cmdset *cmdset = f->cmdset;
847 uint32_t ndcr; 847 uint32_t ndcr;
848 uint8_t id_buff[8]; 848 uint8_t id_buff[8];
849 849