diff options
Diffstat (limited to 'drivers/mtd/maps')
27 files changed, 72 insertions, 63 deletions
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 5ea169362164..0225cbbf22de 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig | |||
@@ -10,8 +10,8 @@ config MTD_COMPLEX_MAPPINGS | |||
10 | paged mappings of flash chips. | 10 | paged mappings of flash chips. |
11 | 11 | ||
12 | config MTD_PHYSMAP | 12 | config MTD_PHYSMAP |
13 | tristate "CFI Flash device in physical memory map" | 13 | tristate "Flash device in physical memory map" |
14 | depends on MTD_CFI || MTD_JEDECPROBE || MTD_ROM | 14 | depends on MTD_CFI || MTD_JEDECPROBE || MTD_ROM || MTD_LPDDR |
15 | help | 15 | help |
16 | This provides a 'mapping' driver which allows the NOR Flash and | 16 | This provides a 'mapping' driver which allows the NOR Flash and |
17 | ROM driver code to communicate with chips which are mapped | 17 | ROM driver code to communicate with chips which are mapped |
@@ -23,9 +23,20 @@ config MTD_PHYSMAP | |||
23 | To compile this driver as a module, choose M here: the | 23 | To compile this driver as a module, choose M here: the |
24 | module will be called physmap. | 24 | module will be called physmap. |
25 | 25 | ||
26 | config MTD_PHYSMAP_COMPAT | ||
27 | bool "Physmap compat support" | ||
28 | depends on MTD_PHYSMAP | ||
29 | default n | ||
30 | help | ||
31 | Setup a simple mapping via the Kconfig options. Normally the | ||
32 | physmap configuration options are done via your board's | ||
33 | resource file. | ||
34 | |||
35 | If unsure, say N here. | ||
36 | |||
26 | config MTD_PHYSMAP_START | 37 | config MTD_PHYSMAP_START |
27 | hex "Physical start address of flash mapping" | 38 | hex "Physical start address of flash mapping" |
28 | depends on MTD_PHYSMAP | 39 | depends on MTD_PHYSMAP_COMPAT |
29 | default "0x8000000" | 40 | default "0x8000000" |
30 | help | 41 | help |
31 | This is the physical memory location at which the flash chips | 42 | This is the physical memory location at which the flash chips |
@@ -37,7 +48,7 @@ config MTD_PHYSMAP_START | |||
37 | 48 | ||
38 | config MTD_PHYSMAP_LEN | 49 | config MTD_PHYSMAP_LEN |
39 | hex "Physical length of flash mapping" | 50 | hex "Physical length of flash mapping" |
40 | depends on MTD_PHYSMAP | 51 | depends on MTD_PHYSMAP_COMPAT |
41 | default "0" | 52 | default "0" |
42 | help | 53 | help |
43 | This is the total length of the mapping of the flash chips on | 54 | This is the total length of the mapping of the flash chips on |
@@ -51,7 +62,7 @@ config MTD_PHYSMAP_LEN | |||
51 | 62 | ||
52 | config MTD_PHYSMAP_BANKWIDTH | 63 | config MTD_PHYSMAP_BANKWIDTH |
53 | int "Bank width in octets" | 64 | int "Bank width in octets" |
54 | depends on MTD_PHYSMAP | 65 | depends on MTD_PHYSMAP_COMPAT |
55 | default "2" | 66 | default "2" |
56 | help | 67 | help |
57 | This is the total width of the data bus of the flash devices | 68 | This is the total width of the data bus of the flash devices |
diff --git a/drivers/mtd/maps/alchemy-flash.c b/drivers/mtd/maps/alchemy-flash.c index 82811bcb0436..845ad4f2a542 100644 --- a/drivers/mtd/maps/alchemy-flash.c +++ b/drivers/mtd/maps/alchemy-flash.c | |||
@@ -111,7 +111,7 @@ static struct mtd_partition alchemy_partitions[] = { | |||
111 | 111 | ||
112 | static struct mtd_info *mymtd; | 112 | static struct mtd_info *mymtd; |
113 | 113 | ||
114 | int __init alchemy_mtd_init(void) | 114 | static int __init alchemy_mtd_init(void) |
115 | { | 115 | { |
116 | struct mtd_partition *parts; | 116 | struct mtd_partition *parts; |
117 | int nb_parts = 0; | 117 | int nb_parts = 0; |
diff --git a/drivers/mtd/maps/amd76xrom.c b/drivers/mtd/maps/amd76xrom.c index d1eec7d3243f..237733d094c4 100644 --- a/drivers/mtd/maps/amd76xrom.c +++ b/drivers/mtd/maps/amd76xrom.c | |||
@@ -232,8 +232,8 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev, | |||
232 | /* Trim the size if we are larger than the map */ | 232 | /* Trim the size if we are larger than the map */ |
233 | if (map->mtd->size > map->map.size) { | 233 | if (map->mtd->size > map->map.size) { |
234 | printk(KERN_WARNING MOD_NAME | 234 | printk(KERN_WARNING MOD_NAME |
235 | " rom(%u) larger than window(%lu). fixing...\n", | 235 | " rom(%llu) larger than window(%lu). fixing...\n", |
236 | map->mtd->size, map->map.size); | 236 | (unsigned long long)map->mtd->size, map->map.size); |
237 | map->mtd->size = map->map.size; | 237 | map->mtd->size = map->map.size; |
238 | } | 238 | } |
239 | if (window->rsrc.parent) { | 239 | if (window->rsrc.parent) { |
diff --git a/drivers/mtd/maps/cfi_flagadm.c b/drivers/mtd/maps/cfi_flagadm.c index 0ecc3f6d735b..b4ed81611918 100644 --- a/drivers/mtd/maps/cfi_flagadm.c +++ b/drivers/mtd/maps/cfi_flagadm.c | |||
@@ -88,7 +88,7 @@ struct mtd_partition flagadm_parts[] = { | |||
88 | 88 | ||
89 | static struct mtd_info *mymtd; | 89 | static struct mtd_info *mymtd; |
90 | 90 | ||
91 | int __init init_flagadm(void) | 91 | static int __init init_flagadm(void) |
92 | { | 92 | { |
93 | printk(KERN_NOTICE "FlagaDM flash device: %x at %x\n", | 93 | printk(KERN_NOTICE "FlagaDM flash device: %x at %x\n", |
94 | FLASH_SIZE, FLASH_PHYS_ADDR); | 94 | FLASH_SIZE, FLASH_PHYS_ADDR); |
diff --git a/drivers/mtd/maps/ck804xrom.c b/drivers/mtd/maps/ck804xrom.c index 1a6feb4474de..5f7a245ed132 100644 --- a/drivers/mtd/maps/ck804xrom.c +++ b/drivers/mtd/maps/ck804xrom.c | |||
@@ -263,8 +263,8 @@ static int __devinit ck804xrom_init_one (struct pci_dev *pdev, | |||
263 | /* Trim the size if we are larger than the map */ | 263 | /* Trim the size if we are larger than the map */ |
264 | if (map->mtd->size > map->map.size) { | 264 | if (map->mtd->size > map->map.size) { |
265 | printk(KERN_WARNING MOD_NAME | 265 | printk(KERN_WARNING MOD_NAME |
266 | " rom(%u) larger than window(%lu). fixing...\n", | 266 | " rom(%llu) larger than window(%lu). fixing...\n", |
267 | map->mtd->size, map->map.size); | 267 | (unsigned long long)map->mtd->size, map->map.size); |
268 | map->mtd->size = map->map.size; | 268 | map->mtd->size = map->map.size; |
269 | } | 269 | } |
270 | if (window->rsrc.parent) { | 270 | if (window->rsrc.parent) { |
diff --git a/drivers/mtd/maps/dbox2-flash.c b/drivers/mtd/maps/dbox2-flash.c index e115667bf1d0..cfacfa6f45dd 100644 --- a/drivers/mtd/maps/dbox2-flash.c +++ b/drivers/mtd/maps/dbox2-flash.c | |||
@@ -69,7 +69,7 @@ struct map_info dbox2_flash_map = { | |||
69 | .phys = WINDOW_ADDR, | 69 | .phys = WINDOW_ADDR, |
70 | }; | 70 | }; |
71 | 71 | ||
72 | int __init init_dbox2_flash(void) | 72 | static int __init init_dbox2_flash(void) |
73 | { | 73 | { |
74 | printk(KERN_NOTICE "D-Box 2 flash driver (size->0x%X mem->0x%X)\n", WINDOW_SIZE, WINDOW_ADDR); | 74 | printk(KERN_NOTICE "D-Box 2 flash driver (size->0x%X mem->0x%X)\n", WINDOW_SIZE, WINDOW_ADDR); |
75 | dbox2_flash_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE); | 75 | dbox2_flash_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE); |
diff --git a/drivers/mtd/maps/edb7312.c b/drivers/mtd/maps/edb7312.c index 9433738c1664..be9e90b44587 100644 --- a/drivers/mtd/maps/edb7312.c +++ b/drivers/mtd/maps/edb7312.c | |||
@@ -71,7 +71,7 @@ static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; | |||
71 | static int mtd_parts_nb = 0; | 71 | static int mtd_parts_nb = 0; |
72 | static struct mtd_partition *mtd_parts = 0; | 72 | static struct mtd_partition *mtd_parts = 0; |
73 | 73 | ||
74 | int __init init_edb7312nor(void) | 74 | static int __init init_edb7312nor(void) |
75 | { | 75 | { |
76 | static const char *rom_probe_types[] = PROBETYPES; | 76 | static const char *rom_probe_types[] = PROBETYPES; |
77 | const char **type; | 77 | const char **type; |
diff --git a/drivers/mtd/maps/esb2rom.c b/drivers/mtd/maps/esb2rom.c index bbbcdd4c8d13..11a2f57df9cf 100644 --- a/drivers/mtd/maps/esb2rom.c +++ b/drivers/mtd/maps/esb2rom.c | |||
@@ -324,8 +324,8 @@ static int __devinit esb2rom_init_one(struct pci_dev *pdev, | |||
324 | /* Trim the size if we are larger than the map */ | 324 | /* Trim the size if we are larger than the map */ |
325 | if (map->mtd->size > map->map.size) { | 325 | if (map->mtd->size > map->map.size) { |
326 | printk(KERN_WARNING MOD_NAME | 326 | printk(KERN_WARNING MOD_NAME |
327 | " rom(%u) larger than window(%lu). fixing...\n", | 327 | " rom(%llu) larger than window(%lu). fixing...\n", |
328 | map->mtd->size, map->map.size); | 328 | (unsigned long long)map->mtd->size, map->map.size); |
329 | map->mtd->size = map->map.size; | 329 | map->mtd->size = map->map.size; |
330 | } | 330 | } |
331 | if (window->rsrc.parent) { | 331 | if (window->rsrc.parent) { |
diff --git a/drivers/mtd/maps/fortunet.c b/drivers/mtd/maps/fortunet.c index a8e3fde4cbd5..1e43124d498b 100644 --- a/drivers/mtd/maps/fortunet.c +++ b/drivers/mtd/maps/fortunet.c | |||
@@ -181,7 +181,7 @@ __setup("MTD_Partition=", MTD_New_Partition); | |||
181 | /* Backwards-spelling-compatibility */ | 181 | /* Backwards-spelling-compatibility */ |
182 | __setup("MTD_Partion=", MTD_New_Partition); | 182 | __setup("MTD_Partion=", MTD_New_Partition); |
183 | 183 | ||
184 | int __init init_fortunet(void) | 184 | static int __init init_fortunet(void) |
185 | { | 185 | { |
186 | int ix,iy; | 186 | int ix,iy; |
187 | for(iy=ix=0;ix<MAX_NUM_REGIONS;ix++) | 187 | for(iy=ix=0;ix<MAX_NUM_REGIONS;ix++) |
diff --git a/drivers/mtd/maps/h720x-flash.c b/drivers/mtd/maps/h720x-flash.c index 3b959fad1c4e..72c724fa8c27 100644 --- a/drivers/mtd/maps/h720x-flash.c +++ b/drivers/mtd/maps/h720x-flash.c | |||
@@ -65,7 +65,7 @@ static const char *probes[] = { "cmdlinepart", NULL }; | |||
65 | /* | 65 | /* |
66 | * Initialize FLASH support | 66 | * Initialize FLASH support |
67 | */ | 67 | */ |
68 | int __init h720x_mtd_init(void) | 68 | static int __init h720x_mtd_init(void) |
69 | { | 69 | { |
70 | 70 | ||
71 | char *part_type = NULL; | 71 | char *part_type = NULL; |
diff --git a/drivers/mtd/maps/ichxrom.c b/drivers/mtd/maps/ichxrom.c index aeb6c916e23f..c32bc28920b3 100644 --- a/drivers/mtd/maps/ichxrom.c +++ b/drivers/mtd/maps/ichxrom.c | |||
@@ -258,8 +258,8 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev, | |||
258 | /* Trim the size if we are larger than the map */ | 258 | /* Trim the size if we are larger than the map */ |
259 | if (map->mtd->size > map->map.size) { | 259 | if (map->mtd->size > map->map.size) { |
260 | printk(KERN_WARNING MOD_NAME | 260 | printk(KERN_WARNING MOD_NAME |
261 | " rom(%u) larger than window(%lu). fixing...\n", | 261 | " rom(%llu) larger than window(%lu). fixing...\n", |
262 | map->mtd->size, map->map.size); | 262 | (unsigned long long)map->mtd->size, map->map.size); |
263 | map->mtd->size = map->map.size; | 263 | map->mtd->size = map->map.size; |
264 | } | 264 | } |
265 | if (window->rsrc.parent) { | 265 | if (window->rsrc.parent) { |
diff --git a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c index 2682ab51a367..998a27da97f3 100644 --- a/drivers/mtd/maps/impa7.c +++ b/drivers/mtd/maps/impa7.c | |||
@@ -70,7 +70,7 @@ static struct mtd_partition *mtd_parts[NUM_FLASHBANKS]; | |||
70 | 70 | ||
71 | static const char *probes[] = { "cmdlinepart", NULL }; | 71 | static const char *probes[] = { "cmdlinepart", NULL }; |
72 | 72 | ||
73 | int __init init_impa7(void) | 73 | static int __init init_impa7(void) |
74 | { | 74 | { |
75 | static const char *rom_probe_types[] = PROBETYPES; | 75 | static const char *rom_probe_types[] = PROBETYPES; |
76 | const char **type; | 76 | const char **type; |
diff --git a/drivers/mtd/maps/ipaq-flash.c b/drivers/mtd/maps/ipaq-flash.c index ed58f6a77bd9..748c85f635f1 100644 --- a/drivers/mtd/maps/ipaq-flash.c +++ b/drivers/mtd/maps/ipaq-flash.c | |||
@@ -202,7 +202,7 @@ static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; | |||
202 | 202 | ||
203 | static int __init h1900_special_case(void); | 203 | static int __init h1900_special_case(void); |
204 | 204 | ||
205 | int __init ipaq_mtd_init(void) | 205 | static int __init ipaq_mtd_init(void) |
206 | { | 206 | { |
207 | struct mtd_partition *parts = NULL; | 207 | struct mtd_partition *parts = NULL; |
208 | int nb_parts = 0; | 208 | int nb_parts = 0; |
diff --git a/drivers/mtd/maps/mbx860.c b/drivers/mtd/maps/mbx860.c index 706f67394b07..0eb5a7c85380 100644 --- a/drivers/mtd/maps/mbx860.c +++ b/drivers/mtd/maps/mbx860.c | |||
@@ -55,7 +55,7 @@ struct map_info mbx_map = { | |||
55 | .bankwidth = 4, | 55 | .bankwidth = 4, |
56 | }; | 56 | }; |
57 | 57 | ||
58 | int __init init_mbx(void) | 58 | static int __init init_mbx(void) |
59 | { | 59 | { |
60 | printk(KERN_NOTICE "Motorola MBX flash device: 0x%x at 0x%x\n", WINDOW_SIZE*4, WINDOW_ADDR); | 60 | printk(KERN_NOTICE "Motorola MBX flash device: 0x%x at 0x%x\n", WINDOW_SIZE*4, WINDOW_ADDR); |
61 | mbx_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE * 4); | 61 | mbx_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE * 4); |
diff --git a/drivers/mtd/maps/nettel.c b/drivers/mtd/maps/nettel.c index 965e6c6d6ab0..a97133eb9d70 100644 --- a/drivers/mtd/maps/nettel.c +++ b/drivers/mtd/maps/nettel.c | |||
@@ -226,7 +226,7 @@ static int __init nettel_init(void) | |||
226 | 226 | ||
227 | if ((amd_mtd = do_map_probe("jedec_probe", &nettel_amd_map))) { | 227 | if ((amd_mtd = do_map_probe("jedec_probe", &nettel_amd_map))) { |
228 | printk(KERN_NOTICE "SNAPGEAR: AMD flash device size = %dK\n", | 228 | printk(KERN_NOTICE "SNAPGEAR: AMD flash device size = %dK\n", |
229 | amd_mtd->size>>10); | 229 | (int)(amd_mtd->size>>10)); |
230 | 230 | ||
231 | amd_mtd->owner = THIS_MODULE; | 231 | amd_mtd->owner = THIS_MODULE; |
232 | 232 | ||
@@ -357,13 +357,12 @@ static int __init nettel_init(void) | |||
357 | *intel1par = 0; | 357 | *intel1par = 0; |
358 | } | 358 | } |
359 | 359 | ||
360 | printk(KERN_NOTICE "SNAPGEAR: Intel flash device size = %dK\n", | 360 | printk(KERN_NOTICE "SNAPGEAR: Intel flash device size = %lldKiB\n", |
361 | (intel_mtd->size >> 10)); | 361 | (unsigned long long)(intel_mtd->size >> 10)); |
362 | 362 | ||
363 | intel_mtd->owner = THIS_MODULE; | 363 | intel_mtd->owner = THIS_MODULE; |
364 | 364 | ||
365 | num_intel_partitions = sizeof(nettel_intel_partitions) / | 365 | num_intel_partitions = ARRAY_SIZE(nettel_intel_partitions); |
366 | sizeof(nettel_intel_partitions[0]); | ||
367 | 366 | ||
368 | if (intelboot) { | 367 | if (intelboot) { |
369 | /* | 368 | /* |
diff --git a/drivers/mtd/maps/octagon-5066.c b/drivers/mtd/maps/octagon-5066.c index 43e04c1d22a9..2b2e45093218 100644 --- a/drivers/mtd/maps/octagon-5066.c +++ b/drivers/mtd/maps/octagon-5066.c | |||
@@ -184,7 +184,7 @@ void cleanup_oct5066(void) | |||
184 | release_region(PAGE_IO, 1); | 184 | release_region(PAGE_IO, 1); |
185 | } | 185 | } |
186 | 186 | ||
187 | int __init init_oct5066(void) | 187 | static int __init init_oct5066(void) |
188 | { | 188 | { |
189 | int i; | 189 | int i; |
190 | int ret = 0; | 190 | int ret = 0; |
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 1db16e549e38..87743661d48e 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c | |||
@@ -29,7 +29,6 @@ struct physmap_flash_info { | |||
29 | struct map_info map[MAX_RESOURCES]; | 29 | struct map_info map[MAX_RESOURCES]; |
30 | #ifdef CONFIG_MTD_PARTITIONS | 30 | #ifdef CONFIG_MTD_PARTITIONS |
31 | int nr_parts; | 31 | int nr_parts; |
32 | struct mtd_partition *parts; | ||
33 | #endif | 32 | #endif |
34 | }; | 33 | }; |
35 | 34 | ||
@@ -56,14 +55,10 @@ static int physmap_flash_remove(struct platform_device *dev) | |||
56 | for (i = 0; i < MAX_RESOURCES; i++) { | 55 | for (i = 0; i < MAX_RESOURCES; i++) { |
57 | if (info->mtd[i] != NULL) { | 56 | if (info->mtd[i] != NULL) { |
58 | #ifdef CONFIG_MTD_PARTITIONS | 57 | #ifdef CONFIG_MTD_PARTITIONS |
59 | if (info->nr_parts) { | 58 | if (info->nr_parts || physmap_data->nr_parts) |
60 | del_mtd_partitions(info->mtd[i]); | 59 | del_mtd_partitions(info->mtd[i]); |
61 | kfree(info->parts); | 60 | else |
62 | } else if (physmap_data->nr_parts) { | ||
63 | del_mtd_partitions(info->mtd[i]); | ||
64 | } else { | ||
65 | del_mtd_device(info->mtd[i]); | 61 | del_mtd_device(info->mtd[i]); |
66 | } | ||
67 | #else | 62 | #else |
68 | del_mtd_device(info->mtd[i]); | 63 | del_mtd_device(info->mtd[i]); |
69 | #endif | 64 | #endif |
@@ -73,7 +68,12 @@ static int physmap_flash_remove(struct platform_device *dev) | |||
73 | return 0; | 68 | return 0; |
74 | } | 69 | } |
75 | 70 | ||
76 | static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL }; | 71 | static const char *rom_probe_types[] = { |
72 | "cfi_probe", | ||
73 | "jedec_probe", | ||
74 | "qinfo_probe", | ||
75 | "map_rom", | ||
76 | NULL }; | ||
77 | #ifdef CONFIG_MTD_PARTITIONS | 77 | #ifdef CONFIG_MTD_PARTITIONS |
78 | static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; | 78 | static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; |
79 | #endif | 79 | #endif |
@@ -86,6 +86,9 @@ static int physmap_flash_probe(struct platform_device *dev) | |||
86 | int err = 0; | 86 | int err = 0; |
87 | int i; | 87 | int i; |
88 | int devices_found = 0; | 88 | int devices_found = 0; |
89 | #ifdef CONFIG_MTD_PARTITIONS | ||
90 | struct mtd_partition *parts; | ||
91 | #endif | ||
89 | 92 | ||
90 | physmap_data = dev->dev.platform_data; | 93 | physmap_data = dev->dev.platform_data; |
91 | if (physmap_data == NULL) | 94 | if (physmap_data == NULL) |
@@ -119,6 +122,7 @@ static int physmap_flash_probe(struct platform_device *dev) | |||
119 | info->map[i].size = dev->resource[i].end - dev->resource[i].start + 1; | 122 | info->map[i].size = dev->resource[i].end - dev->resource[i].start + 1; |
120 | info->map[i].bankwidth = physmap_data->width; | 123 | info->map[i].bankwidth = physmap_data->width; |
121 | info->map[i].set_vpp = physmap_data->set_vpp; | 124 | info->map[i].set_vpp = physmap_data->set_vpp; |
125 | info->map[i].pfow_base = physmap_data->pfow_base; | ||
122 | 126 | ||
123 | info->map[i].virt = devm_ioremap(&dev->dev, info->map[i].phys, | 127 | info->map[i].virt = devm_ioremap(&dev->dev, info->map[i].phys, |
124 | info->map[i].size); | 128 | info->map[i].size); |
@@ -163,9 +167,10 @@ static int physmap_flash_probe(struct platform_device *dev) | |||
163 | goto err_out; | 167 | goto err_out; |
164 | 168 | ||
165 | #ifdef CONFIG_MTD_PARTITIONS | 169 | #ifdef CONFIG_MTD_PARTITIONS |
166 | err = parse_mtd_partitions(info->cmtd, part_probe_types, &info->parts, 0); | 170 | err = parse_mtd_partitions(info->cmtd, part_probe_types, &parts, 0); |
167 | if (err > 0) { | 171 | if (err > 0) { |
168 | add_mtd_partitions(info->cmtd, info->parts, err); | 172 | add_mtd_partitions(info->cmtd, parts, err); |
173 | kfree(parts); | ||
169 | return 0; | 174 | return 0; |
170 | } | 175 | } |
171 | 176 | ||
@@ -251,14 +256,7 @@ static struct platform_driver physmap_flash_driver = { | |||
251 | }; | 256 | }; |
252 | 257 | ||
253 | 258 | ||
254 | #ifdef CONFIG_MTD_PHYSMAP_LEN | 259 | #ifdef CONFIG_MTD_PHYSMAP_COMPAT |
255 | #if CONFIG_MTD_PHYSMAP_LEN != 0 | ||
256 | #warning using PHYSMAP compat code | ||
257 | #define PHYSMAP_COMPAT | ||
258 | #endif | ||
259 | #endif | ||
260 | |||
261 | #ifdef PHYSMAP_COMPAT | ||
262 | static struct physmap_flash_data physmap_flash_data = { | 260 | static struct physmap_flash_data physmap_flash_data = { |
263 | .width = CONFIG_MTD_PHYSMAP_BANKWIDTH, | 261 | .width = CONFIG_MTD_PHYSMAP_BANKWIDTH, |
264 | }; | 262 | }; |
@@ -302,7 +300,7 @@ static int __init physmap_init(void) | |||
302 | int err; | 300 | int err; |
303 | 301 | ||
304 | err = platform_driver_register(&physmap_flash_driver); | 302 | err = platform_driver_register(&physmap_flash_driver); |
305 | #ifdef PHYSMAP_COMPAT | 303 | #ifdef CONFIG_MTD_PHYSMAP_COMPAT |
306 | if (err == 0) | 304 | if (err == 0) |
307 | platform_device_register(&physmap_flash); | 305 | platform_device_register(&physmap_flash); |
308 | #endif | 306 | #endif |
@@ -312,7 +310,7 @@ static int __init physmap_init(void) | |||
312 | 310 | ||
313 | static void __exit physmap_exit(void) | 311 | static void __exit physmap_exit(void) |
314 | { | 312 | { |
315 | #ifdef PHYSMAP_COMPAT | 313 | #ifdef CONFIG_MTD_PHYSMAP_COMPAT |
316 | platform_device_unregister(&physmap_flash); | 314 | platform_device_unregister(&physmap_flash); |
317 | #endif | 315 | #endif |
318 | platform_driver_unregister(&physmap_flash_driver); | 316 | platform_driver_unregister(&physmap_flash_driver); |
@@ -326,8 +324,7 @@ MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); | |||
326 | MODULE_DESCRIPTION("Generic configurable MTD map driver"); | 324 | MODULE_DESCRIPTION("Generic configurable MTD map driver"); |
327 | 325 | ||
328 | /* legacy platform drivers can't hotplug or coldplg */ | 326 | /* legacy platform drivers can't hotplug or coldplg */ |
329 | #ifndef PHYSMAP_COMPAT | 327 | #ifndef CONFIG_MTD_PHYSMAP_COMPAT |
330 | /* work with hotplug and coldplug */ | 328 | /* work with hotplug and coldplug */ |
331 | MODULE_ALIAS("platform:physmap-flash"); | 329 | MODULE_ALIAS("platform:physmap-flash"); |
332 | #endif | 330 | #endif |
333 | |||
diff --git a/drivers/mtd/maps/pmcmsp-flash.c b/drivers/mtd/maps/pmcmsp-flash.c index f43ba2815cbb..4768bd5459d6 100644 --- a/drivers/mtd/maps/pmcmsp-flash.c +++ b/drivers/mtd/maps/pmcmsp-flash.c | |||
@@ -48,7 +48,7 @@ static int fcnt; | |||
48 | 48 | ||
49 | #define DEBUG_MARKER printk(KERN_NOTICE "%s[%d]\n", __func__, __LINE__) | 49 | #define DEBUG_MARKER printk(KERN_NOTICE "%s[%d]\n", __func__, __LINE__) |
50 | 50 | ||
51 | int __init init_msp_flash(void) | 51 | static int __init init_msp_flash(void) |
52 | { | 52 | { |
53 | int i, j; | 53 | int i, j; |
54 | int offset, coff; | 54 | int offset, coff; |
diff --git a/drivers/mtd/maps/redwood.c b/drivers/mtd/maps/redwood.c index de002eb1a7fe..933c0b63b016 100644 --- a/drivers/mtd/maps/redwood.c +++ b/drivers/mtd/maps/redwood.c | |||
@@ -122,7 +122,7 @@ struct map_info redwood_flash_map = { | |||
122 | 122 | ||
123 | static struct mtd_info *redwood_mtd; | 123 | static struct mtd_info *redwood_mtd; |
124 | 124 | ||
125 | int __init init_redwood_flash(void) | 125 | static int __init init_redwood_flash(void) |
126 | { | 126 | { |
127 | int err; | 127 | int err; |
128 | 128 | ||
diff --git a/drivers/mtd/maps/rpxlite.c b/drivers/mtd/maps/rpxlite.c index 14d90edb4430..3e3ef53d4fd4 100644 --- a/drivers/mtd/maps/rpxlite.c +++ b/drivers/mtd/maps/rpxlite.c | |||
@@ -23,7 +23,7 @@ static struct map_info rpxlite_map = { | |||
23 | .phys = WINDOW_ADDR, | 23 | .phys = WINDOW_ADDR, |
24 | }; | 24 | }; |
25 | 25 | ||
26 | int __init init_rpxlite(void) | 26 | static int __init init_rpxlite(void) |
27 | { | 27 | { |
28 | printk(KERN_NOTICE "RPX Lite or CLLF flash device: %x at %x\n", WINDOW_SIZE*4, WINDOW_ADDR); | 28 | printk(KERN_NOTICE "RPX Lite or CLLF flash device: %x at %x\n", WINDOW_SIZE*4, WINDOW_ADDR); |
29 | rpxlite_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE * 4); | 29 | rpxlite_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE * 4); |
diff --git a/drivers/mtd/maps/sbc8240.c b/drivers/mtd/maps/sbc8240.c index 6e1e99cd2b59..d5374cdcb163 100644 --- a/drivers/mtd/maps/sbc8240.c +++ b/drivers/mtd/maps/sbc8240.c | |||
@@ -136,7 +136,7 @@ static struct mtd_part_def sbc8240_part_banks[NUM_FLASH_BANKS]; | |||
136 | #endif /* CONFIG_MTD_PARTITIONS */ | 136 | #endif /* CONFIG_MTD_PARTITIONS */ |
137 | 137 | ||
138 | 138 | ||
139 | int __init init_sbc8240_mtd (void) | 139 | static int __init init_sbc8240_mtd (void) |
140 | { | 140 | { |
141 | static struct _cjs { | 141 | static struct _cjs { |
142 | u_long addr; | 142 | u_long addr; |
diff --git a/drivers/mtd/maps/scb2_flash.c b/drivers/mtd/maps/scb2_flash.c index 21169e6d646c..7e329f09a548 100644 --- a/drivers/mtd/maps/scb2_flash.c +++ b/drivers/mtd/maps/scb2_flash.c | |||
@@ -118,7 +118,8 @@ scb2_fixup_mtd(struct mtd_info *mtd) | |||
118 | struct mtd_erase_region_info *region = &mtd->eraseregions[i]; | 118 | struct mtd_erase_region_info *region = &mtd->eraseregions[i]; |
119 | 119 | ||
120 | if (region->numblocks * region->erasesize > mtd->size) { | 120 | if (region->numblocks * region->erasesize > mtd->size) { |
121 | region->numblocks = (mtd->size / region->erasesize); | 121 | region->numblocks = ((unsigned long)mtd->size / |
122 | region->erasesize); | ||
122 | done = 1; | 123 | done = 1; |
123 | } else { | 124 | } else { |
124 | region->numblocks = 0; | 125 | region->numblocks = 0; |
@@ -187,8 +188,9 @@ scb2_flash_probe(struct pci_dev *dev, const struct pci_device_id *ent) | |||
187 | return -ENODEV; | 188 | return -ENODEV; |
188 | } | 189 | } |
189 | 190 | ||
190 | printk(KERN_NOTICE MODNAME ": chip size 0x%x at offset 0x%x\n", | 191 | printk(KERN_NOTICE MODNAME ": chip size 0x%llx at offset 0x%llx\n", |
191 | scb2_mtd->size, SCB2_WINDOW - scb2_mtd->size); | 192 | (unsigned long long)scb2_mtd->size, |
193 | (unsigned long long)(SCB2_WINDOW - scb2_mtd->size)); | ||
192 | 194 | ||
193 | add_mtd_device(scb2_mtd); | 195 | add_mtd_device(scb2_mtd); |
194 | 196 | ||
diff --git a/drivers/mtd/maps/sharpsl-flash.c b/drivers/mtd/maps/sharpsl-flash.c index 026eab028189..b392f096c706 100644 --- a/drivers/mtd/maps/sharpsl-flash.c +++ b/drivers/mtd/maps/sharpsl-flash.c | |||
@@ -47,7 +47,7 @@ static struct mtd_partition sharpsl_partitions[1] = { | |||
47 | } | 47 | } |
48 | }; | 48 | }; |
49 | 49 | ||
50 | int __init init_sharpsl(void) | 50 | static int __init init_sharpsl(void) |
51 | { | 51 | { |
52 | struct mtd_partition *parts; | 52 | struct mtd_partition *parts; |
53 | int nb_parts = 0; | 53 | int nb_parts = 0; |
diff --git a/drivers/mtd/maps/tqm8xxl.c b/drivers/mtd/maps/tqm8xxl.c index a5d3d8531faa..60146984f4be 100644 --- a/drivers/mtd/maps/tqm8xxl.c +++ b/drivers/mtd/maps/tqm8xxl.c | |||
@@ -109,7 +109,7 @@ static struct mtd_partition tqm8xxl_fs_partitions[] = { | |||
109 | }; | 109 | }; |
110 | #endif | 110 | #endif |
111 | 111 | ||
112 | int __init init_tqm_mtd(void) | 112 | static int __init init_tqm_mtd(void) |
113 | { | 113 | { |
114 | int idx = 0, ret = 0; | 114 | int idx = 0, ret = 0; |
115 | unsigned long flash_addr, flash_size, mtd_size = 0; | 115 | unsigned long flash_addr, flash_size, mtd_size = 0; |
diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c index 0dc645f8152f..81756e397711 100644 --- a/drivers/mtd/maps/uclinux.c +++ b/drivers/mtd/maps/uclinux.c | |||
@@ -51,7 +51,7 @@ int uclinux_point(struct mtd_info *mtd, loff_t from, size_t len, | |||
51 | 51 | ||
52 | /****************************************************************************/ | 52 | /****************************************************************************/ |
53 | 53 | ||
54 | int __init uclinux_mtd_init(void) | 54 | static int __init uclinux_mtd_init(void) |
55 | { | 55 | { |
56 | struct mtd_info *mtd; | 56 | struct mtd_info *mtd; |
57 | struct map_info *mapp; | 57 | struct map_info *mapp; |
@@ -94,7 +94,7 @@ int __init uclinux_mtd_init(void) | |||
94 | 94 | ||
95 | /****************************************************************************/ | 95 | /****************************************************************************/ |
96 | 96 | ||
97 | void __exit uclinux_mtd_cleanup(void) | 97 | static void __exit uclinux_mtd_cleanup(void) |
98 | { | 98 | { |
99 | if (uclinux_ram_mtdinfo) { | 99 | if (uclinux_ram_mtdinfo) { |
100 | del_mtd_partitions(uclinux_ram_mtdinfo); | 100 | del_mtd_partitions(uclinux_ram_mtdinfo); |
diff --git a/drivers/mtd/maps/vmax301.c b/drivers/mtd/maps/vmax301.c index 5a0c9a353b0f..6d452dcdfe34 100644 --- a/drivers/mtd/maps/vmax301.c +++ b/drivers/mtd/maps/vmax301.c | |||
@@ -146,7 +146,7 @@ static void __exit cleanup_vmax301(void) | |||
146 | iounmap((void *)vmax_map[0].map_priv_1 - WINDOW_START); | 146 | iounmap((void *)vmax_map[0].map_priv_1 - WINDOW_START); |
147 | } | 147 | } |
148 | 148 | ||
149 | int __init init_vmax301(void) | 149 | static int __init init_vmax301(void) |
150 | { | 150 | { |
151 | int i; | 151 | int i; |
152 | unsigned long iomapadr; | 152 | unsigned long iomapadr; |
diff --git a/drivers/mtd/maps/wr_sbc82xx_flash.c b/drivers/mtd/maps/wr_sbc82xx_flash.c index 413b0cf9bbd2..933a2b6598b4 100644 --- a/drivers/mtd/maps/wr_sbc82xx_flash.c +++ b/drivers/mtd/maps/wr_sbc82xx_flash.c | |||
@@ -74,7 +74,7 @@ do { \ | |||
74 | } \ | 74 | } \ |
75 | } while (0); | 75 | } while (0); |
76 | 76 | ||
77 | int __init init_sbc82xx_flash(void) | 77 | static int __init init_sbc82xx_flash(void) |
78 | { | 78 | { |
79 | volatile memctl_cpm2_t *mc = &cpm2_immr->im_memctl; | 79 | volatile memctl_cpm2_t *mc = &cpm2_immr->im_memctl; |
80 | int bigflash; | 80 | int bigflash; |