diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-30 20:31:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-30 20:31:56 -0400 |
commit | 623ff7739e7c00fa3d55dbfd42a492a68298fd7a (patch) | |
tree | 0b7461753a1b13b27ea2958a7d48c6efb47bba54 /drivers/mtd/maps | |
parent | c39e8ede284f469971589f2e04af78216e1a771d (diff) | |
parent | 7b0e67f604e1829e5292e1ad7743eb18dc42ea7c (diff) |
Merge tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6
Pull MTD changes from David Woodhouse:
- Artem's cleanup of the MTD API continues apace.
- Fixes and improvements for ST FSMC and SuperH FLCTL NAND, amongst
others.
- More work on DiskOnChip G3, new driver for DiskOnChip G4.
- Clean up debug/warning printks in JFFS2 to use pr_<level>.
Fix up various trivial conflicts, largely due to changes in calling
conventions for things like dmaengine_prep_slave_sg() (new inline
wrapper to hide new parameter, clashing with rewrite of previously last
parameter that used to be an 'append' flag, and is now a bitmap of
'unsigned long flags').
(Also some header file fallout - like so many merges this merge window -
and silly conflicts with sparse fixes)
* tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6: (120 commits)
mtd: docg3 add protection against concurrency
mtd: docg3 refactor cascade floors structure
mtd: docg3 increase write/erase timeout
mtd: docg3 fix inbound calculations
mtd: nand: gpmi: fix function annotations
mtd: phram: fix section mismatch for phram_setup
mtd: unify initialization of erase_info->fail_addr
mtd: support ONFI multi lun NAND
mtd: sm_ftl: fix typo in major number.
mtd: add device-tree support to spear_smi
mtd: spear_smi: Remove default partition information from driver
mtd: Add device-tree support to fsmc_nand
mtd: fix section mismatch for doc_probe_device
mtd: nand/fsmc: Remove sparse warnings and errors
mtd: nand/fsmc: Add DMA support
mtd: nand/fsmc: Access the NAND device word by word whenever possible
mtd: nand/fsmc: Use dev_err to report error scenario
mtd: nand/fsmc: Use devm routines
mtd: nand/fsmc: Modify fsmc driver to accept nand timing parameters via platform
mtd: fsmc_nand: add pm callbacks to support hibernation
...
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r-- | drivers/mtd/maps/bfin-async-flash.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/dc21285.c | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/gpio-addr-flash.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/h720x-flash.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/impa7.c | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/intel_vr_nor.c | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/ixp2000.c | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/ixp4xx.c | 5 | ||||
-rw-r--r-- | drivers/mtd/maps/l440gx.c | 14 | ||||
-rw-r--r-- | drivers/mtd/maps/lantiq-flash.c | 6 | ||||
-rw-r--r-- | drivers/mtd/maps/latch-addr-flash.c | 5 | ||||
-rw-r--r-- | drivers/mtd/maps/pcmciamtd.c | 13 | ||||
-rw-r--r-- | drivers/mtd/maps/physmap.c | 24 | ||||
-rw-r--r-- | drivers/mtd/maps/plat-ram.c | 5 | ||||
-rw-r--r-- | drivers/mtd/maps/pxa2xx-flash.c | 3 | ||||
-rw-r--r-- | drivers/mtd/maps/rbtx4939-flash.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/sa1100-flash.c | 18 | ||||
-rw-r--r-- | drivers/mtd/maps/solutionengine.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/uclinux.c | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/vmu-flash.c | 14 | ||||
-rw-r--r-- | drivers/mtd/maps/wr_sbc82xx_flash.c | 2 |
21 files changed, 92 insertions, 47 deletions
diff --git a/drivers/mtd/maps/bfin-async-flash.c b/drivers/mtd/maps/bfin-async-flash.c index 650126c361f1..ef5cde84a8b3 100644 --- a/drivers/mtd/maps/bfin-async-flash.c +++ b/drivers/mtd/maps/bfin-async-flash.c | |||
@@ -164,8 +164,8 @@ static int __devinit bfin_flash_probe(struct platform_device *pdev) | |||
164 | return -ENXIO; | 164 | return -ENXIO; |
165 | } | 165 | } |
166 | 166 | ||
167 | mtd_device_parse_register(state->mtd, part_probe_types, 0, | 167 | mtd_device_parse_register(state->mtd, part_probe_types, NULL, |
168 | pdata->parts, pdata->nr_parts); | 168 | pdata->parts, pdata->nr_parts); |
169 | 169 | ||
170 | platform_set_drvdata(pdev, state); | 170 | platform_set_drvdata(pdev, state); |
171 | 171 | ||
diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c index f43b365b848c..080f06053bd4 100644 --- a/drivers/mtd/maps/dc21285.c +++ b/drivers/mtd/maps/dc21285.c | |||
@@ -196,7 +196,7 @@ static int __init init_dc21285(void) | |||
196 | 196 | ||
197 | dc21285_mtd->owner = THIS_MODULE; | 197 | dc21285_mtd->owner = THIS_MODULE; |
198 | 198 | ||
199 | mtd_device_parse_register(dc21285_mtd, probes, 0, NULL, 0); | 199 | mtd_device_parse_register(dc21285_mtd, probes, NULL, NULL, 0); |
200 | 200 | ||
201 | if(machine_is_ebsa285()) { | 201 | if(machine_is_ebsa285()) { |
202 | /* | 202 | /* |
diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c index 33cce895859f..e4de96ba52b3 100644 --- a/drivers/mtd/maps/gpio-addr-flash.c +++ b/drivers/mtd/maps/gpio-addr-flash.c | |||
@@ -252,8 +252,8 @@ static int __devinit gpio_flash_probe(struct platform_device *pdev) | |||
252 | } | 252 | } |
253 | 253 | ||
254 | 254 | ||
255 | mtd_device_parse_register(state->mtd, part_probe_types, 0, | 255 | mtd_device_parse_register(state->mtd, part_probe_types, NULL, |
256 | pdata->parts, pdata->nr_parts); | 256 | pdata->parts, pdata->nr_parts); |
257 | 257 | ||
258 | return 0; | 258 | return 0; |
259 | } | 259 | } |
diff --git a/drivers/mtd/maps/h720x-flash.c b/drivers/mtd/maps/h720x-flash.c index 49c14187fc66..8ed6cb4529d8 100644 --- a/drivers/mtd/maps/h720x-flash.c +++ b/drivers/mtd/maps/h720x-flash.c | |||
@@ -85,8 +85,8 @@ static int __init h720x_mtd_init(void) | |||
85 | if (mymtd) { | 85 | if (mymtd) { |
86 | mymtd->owner = THIS_MODULE; | 86 | mymtd->owner = THIS_MODULE; |
87 | 87 | ||
88 | mtd_device_parse_register(mymtd, NULL, 0, | 88 | mtd_device_parse_register(mymtd, NULL, NULL, |
89 | h720x_partitions, NUM_PARTITIONS); | 89 | h720x_partitions, NUM_PARTITIONS); |
90 | return 0; | 90 | return 0; |
91 | } | 91 | } |
92 | 92 | ||
diff --git a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c index f47aedb24366..834a06c56f56 100644 --- a/drivers/mtd/maps/impa7.c +++ b/drivers/mtd/maps/impa7.c | |||
@@ -91,7 +91,7 @@ static int __init init_impa7(void) | |||
91 | if (impa7_mtd[i]) { | 91 | if (impa7_mtd[i]) { |
92 | impa7_mtd[i]->owner = THIS_MODULE; | 92 | impa7_mtd[i]->owner = THIS_MODULE; |
93 | devicesfound++; | 93 | devicesfound++; |
94 | mtd_device_parse_register(impa7_mtd[i], NULL, 0, | 94 | mtd_device_parse_register(impa7_mtd[i], NULL, NULL, |
95 | partitions, | 95 | partitions, |
96 | ARRAY_SIZE(partitions)); | 96 | ARRAY_SIZE(partitions)); |
97 | } | 97 | } |
diff --git a/drivers/mtd/maps/intel_vr_nor.c b/drivers/mtd/maps/intel_vr_nor.c index 08c239604ee4..92e1f41634c7 100644 --- a/drivers/mtd/maps/intel_vr_nor.c +++ b/drivers/mtd/maps/intel_vr_nor.c | |||
@@ -72,7 +72,7 @@ static int __devinit vr_nor_init_partitions(struct vr_nor_mtd *p) | |||
72 | { | 72 | { |
73 | /* register the flash bank */ | 73 | /* register the flash bank */ |
74 | /* partition the flash bank */ | 74 | /* partition the flash bank */ |
75 | return mtd_device_parse_register(p->info, NULL, 0, NULL, 0); | 75 | return mtd_device_parse_register(p->info, NULL, NULL, NULL, 0); |
76 | } | 76 | } |
77 | 77 | ||
78 | static void __devexit vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p) | 78 | static void __devexit vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p) |
diff --git a/drivers/mtd/maps/ixp2000.c b/drivers/mtd/maps/ixp2000.c index fc7d4d0d9a4e..4a41ced0f710 100644 --- a/drivers/mtd/maps/ixp2000.c +++ b/drivers/mtd/maps/ixp2000.c | |||
@@ -226,7 +226,7 @@ static int ixp2000_flash_probe(struct platform_device *dev) | |||
226 | } | 226 | } |
227 | info->mtd->owner = THIS_MODULE; | 227 | info->mtd->owner = THIS_MODULE; |
228 | 228 | ||
229 | err = mtd_device_parse_register(info->mtd, probes, 0, NULL, 0); | 229 | err = mtd_device_parse_register(info->mtd, probes, NULL, NULL, 0); |
230 | if (err) | 230 | if (err) |
231 | goto Error; | 231 | goto Error; |
232 | 232 | ||
diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c index 8b5410162d70..e864fc6c58f9 100644 --- a/drivers/mtd/maps/ixp4xx.c +++ b/drivers/mtd/maps/ixp4xx.c | |||
@@ -182,6 +182,9 @@ static int ixp4xx_flash_probe(struct platform_device *dev) | |||
182 | { | 182 | { |
183 | struct flash_platform_data *plat = dev->dev.platform_data; | 183 | struct flash_platform_data *plat = dev->dev.platform_data; |
184 | struct ixp4xx_flash_info *info; | 184 | struct ixp4xx_flash_info *info; |
185 | struct mtd_part_parser_data ppdata = { | ||
186 | .origin = dev->resource->start, | ||
187 | }; | ||
185 | int err = -1; | 188 | int err = -1; |
186 | 189 | ||
187 | if (!plat) | 190 | if (!plat) |
@@ -247,7 +250,7 @@ static int ixp4xx_flash_probe(struct platform_device *dev) | |||
247 | /* Use the fast version */ | 250 | /* Use the fast version */ |
248 | info->map.write = ixp4xx_write16; | 251 | info->map.write = ixp4xx_write16; |
249 | 252 | ||
250 | err = mtd_device_parse_register(info->mtd, probes, dev->resource->start, | 253 | err = mtd_device_parse_register(info->mtd, probes, &ppdata, |
251 | plat->parts, plat->nr_parts); | 254 | plat->parts, plat->nr_parts); |
252 | if (err) { | 255 | if (err) { |
253 | printk(KERN_ERR "Could not parse partitions\n"); | 256 | printk(KERN_ERR "Could not parse partitions\n"); |
diff --git a/drivers/mtd/maps/l440gx.c b/drivers/mtd/maps/l440gx.c index dd0360ba2412..74bd98ee635f 100644 --- a/drivers/mtd/maps/l440gx.c +++ b/drivers/mtd/maps/l440gx.c | |||
@@ -27,17 +27,21 @@ static struct mtd_info *mymtd; | |||
27 | 27 | ||
28 | 28 | ||
29 | /* Is this really the vpp port? */ | 29 | /* Is this really the vpp port? */ |
30 | static DEFINE_SPINLOCK(l440gx_vpp_lock); | ||
31 | static int l440gx_vpp_refcnt; | ||
30 | static void l440gx_set_vpp(struct map_info *map, int vpp) | 32 | static void l440gx_set_vpp(struct map_info *map, int vpp) |
31 | { | 33 | { |
32 | unsigned long l; | 34 | unsigned long flags; |
33 | 35 | ||
34 | l = inl(VPP_PORT); | 36 | spin_lock_irqsave(&l440gx_vpp_lock, flags); |
35 | if (vpp) { | 37 | if (vpp) { |
36 | l |= 1; | 38 | if (++l440gx_vpp_refcnt == 1) /* first nested 'on' */ |
39 | outl(inl(VPP_PORT) | 1, VPP_PORT); | ||
37 | } else { | 40 | } else { |
38 | l &= ~1; | 41 | if (--l440gx_vpp_refcnt == 0) /* last nested 'off' */ |
42 | outl(inl(VPP_PORT) & ~1, VPP_PORT); | ||
39 | } | 43 | } |
40 | outl(l, VPP_PORT); | 44 | spin_unlock_irqrestore(&l440gx_vpp_lock, flags); |
41 | } | 45 | } |
42 | 46 | ||
43 | static struct map_info l440gx_map = { | 47 | static struct map_info l440gx_map = { |
diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c index 7b889de9477b..b5401e355745 100644 --- a/drivers/mtd/maps/lantiq-flash.c +++ b/drivers/mtd/maps/lantiq-flash.c | |||
@@ -45,6 +45,7 @@ struct ltq_mtd { | |||
45 | }; | 45 | }; |
46 | 46 | ||
47 | static char ltq_map_name[] = "ltq_nor"; | 47 | static char ltq_map_name[] = "ltq_nor"; |
48 | static const char *ltq_probe_types[] __devinitconst = { "cmdlinepart", NULL }; | ||
48 | 49 | ||
49 | static map_word | 50 | static map_word |
50 | ltq_read16(struct map_info *map, unsigned long adr) | 51 | ltq_read16(struct map_info *map, unsigned long adr) |
@@ -168,8 +169,9 @@ ltq_mtd_probe(struct platform_device *pdev) | |||
168 | cfi->addr_unlock1 ^= 1; | 169 | cfi->addr_unlock1 ^= 1; |
169 | cfi->addr_unlock2 ^= 1; | 170 | cfi->addr_unlock2 ^= 1; |
170 | 171 | ||
171 | err = mtd_device_parse_register(ltq_mtd->mtd, NULL, 0, | 172 | err = mtd_device_parse_register(ltq_mtd->mtd, ltq_probe_types, NULL, |
172 | ltq_mtd_data->parts, ltq_mtd_data->nr_parts); | 173 | ltq_mtd_data->parts, |
174 | ltq_mtd_data->nr_parts); | ||
173 | if (err) { | 175 | if (err) { |
174 | dev_err(&pdev->dev, "failed to add partitions\n"); | 176 | dev_err(&pdev->dev, "failed to add partitions\n"); |
175 | goto err_destroy; | 177 | goto err_destroy; |
diff --git a/drivers/mtd/maps/latch-addr-flash.c b/drivers/mtd/maps/latch-addr-flash.c index 8fed58e3a4a8..3c7ad17fca78 100644 --- a/drivers/mtd/maps/latch-addr-flash.c +++ b/drivers/mtd/maps/latch-addr-flash.c | |||
@@ -199,8 +199,9 @@ static int __devinit latch_addr_flash_probe(struct platform_device *dev) | |||
199 | } | 199 | } |
200 | info->mtd->owner = THIS_MODULE; | 200 | info->mtd->owner = THIS_MODULE; |
201 | 201 | ||
202 | mtd_device_parse_register(info->mtd, NULL, 0, | 202 | mtd_device_parse_register(info->mtd, NULL, NULL, |
203 | latch_addr_data->parts, latch_addr_data->nr_parts); | 203 | latch_addr_data->parts, |
204 | latch_addr_data->nr_parts); | ||
204 | return 0; | 205 | return 0; |
205 | 206 | ||
206 | iounmap: | 207 | iounmap: |
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index 0259cf583022..a3cfad392ed6 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c | |||
@@ -294,13 +294,24 @@ static void pcmcia_copy_to(struct map_info *map, unsigned long to, const void *f | |||
294 | } | 294 | } |
295 | 295 | ||
296 | 296 | ||
297 | static DEFINE_SPINLOCK(pcmcia_vpp_lock); | ||
298 | static int pcmcia_vpp_refcnt; | ||
297 | static void pcmciamtd_set_vpp(struct map_info *map, int on) | 299 | static void pcmciamtd_set_vpp(struct map_info *map, int on) |
298 | { | 300 | { |
299 | struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1; | 301 | struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1; |
300 | struct pcmcia_device *link = dev->p_dev; | 302 | struct pcmcia_device *link = dev->p_dev; |
303 | unsigned long flags; | ||
301 | 304 | ||
302 | pr_debug("dev = %p on = %d vpp = %d\n\n", dev, on, dev->vpp); | 305 | pr_debug("dev = %p on = %d vpp = %d\n\n", dev, on, dev->vpp); |
303 | pcmcia_fixup_vpp(link, on ? dev->vpp : 0); | 306 | spin_lock_irqsave(&pcmcia_vpp_lock, flags); |
307 | if (on) { | ||
308 | if (++pcmcia_vpp_refcnt == 1) /* first nested 'on' */ | ||
309 | pcmcia_fixup_vpp(link, dev->vpp); | ||
310 | } else { | ||
311 | if (--pcmcia_vpp_refcnt == 0) /* last nested 'off' */ | ||
312 | pcmcia_fixup_vpp(link, 0); | ||
313 | } | ||
314 | spin_unlock_irqrestore(&pcmcia_vpp_lock, flags); | ||
304 | } | 315 | } |
305 | 316 | ||
306 | 317 | ||
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index abc562653b31..21b0b713cacb 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c | |||
@@ -27,6 +27,8 @@ struct physmap_flash_info { | |||
27 | struct mtd_info *mtd[MAX_RESOURCES]; | 27 | struct mtd_info *mtd[MAX_RESOURCES]; |
28 | struct mtd_info *cmtd; | 28 | struct mtd_info *cmtd; |
29 | struct map_info map[MAX_RESOURCES]; | 29 | struct map_info map[MAX_RESOURCES]; |
30 | spinlock_t vpp_lock; | ||
31 | int vpp_refcnt; | ||
30 | }; | 32 | }; |
31 | 33 | ||
32 | static int physmap_flash_remove(struct platform_device *dev) | 34 | static int physmap_flash_remove(struct platform_device *dev) |
@@ -63,12 +65,26 @@ static void physmap_set_vpp(struct map_info *map, int state) | |||
63 | { | 65 | { |
64 | struct platform_device *pdev; | 66 | struct platform_device *pdev; |
65 | struct physmap_flash_data *physmap_data; | 67 | struct physmap_flash_data *physmap_data; |
68 | struct physmap_flash_info *info; | ||
69 | unsigned long flags; | ||
66 | 70 | ||
67 | pdev = (struct platform_device *)map->map_priv_1; | 71 | pdev = (struct platform_device *)map->map_priv_1; |
68 | physmap_data = pdev->dev.platform_data; | 72 | physmap_data = pdev->dev.platform_data; |
69 | 73 | ||
70 | if (physmap_data->set_vpp) | 74 | if (!physmap_data->set_vpp) |
71 | physmap_data->set_vpp(pdev, state); | 75 | return; |
76 | |||
77 | info = platform_get_drvdata(pdev); | ||
78 | |||
79 | spin_lock_irqsave(&info->vpp_lock, flags); | ||
80 | if (state) { | ||
81 | if (++info->vpp_refcnt == 1) /* first nested 'on' */ | ||
82 | physmap_data->set_vpp(pdev, 1); | ||
83 | } else { | ||
84 | if (--info->vpp_refcnt == 0) /* last nested 'off' */ | ||
85 | physmap_data->set_vpp(pdev, 0); | ||
86 | } | ||
87 | spin_unlock_irqrestore(&info->vpp_lock, flags); | ||
72 | } | 88 | } |
73 | 89 | ||
74 | static const char *rom_probe_types[] = { | 90 | static const char *rom_probe_types[] = { |
@@ -172,9 +188,11 @@ static int physmap_flash_probe(struct platform_device *dev) | |||
172 | if (err) | 188 | if (err) |
173 | goto err_out; | 189 | goto err_out; |
174 | 190 | ||
191 | spin_lock_init(&info->vpp_lock); | ||
192 | |||
175 | part_types = physmap_data->part_probe_types ? : part_probe_types; | 193 | part_types = physmap_data->part_probe_types ? : part_probe_types; |
176 | 194 | ||
177 | mtd_device_parse_register(info->cmtd, part_types, 0, | 195 | mtd_device_parse_register(info->cmtd, part_types, NULL, |
178 | physmap_data->parts, physmap_data->nr_parts); | 196 | physmap_data->parts, physmap_data->nr_parts); |
179 | return 0; | 197 | return 0; |
180 | 198 | ||
diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c index 45876d0e5b8e..891558de3ec1 100644 --- a/drivers/mtd/maps/plat-ram.c +++ b/drivers/mtd/maps/plat-ram.c | |||
@@ -222,8 +222,9 @@ static int platram_probe(struct platform_device *pdev) | |||
222 | /* check to see if there are any available partitions, or wether | 222 | /* check to see if there are any available partitions, or wether |
223 | * to add this device whole */ | 223 | * to add this device whole */ |
224 | 224 | ||
225 | err = mtd_device_parse_register(info->mtd, pdata->probes, 0, | 225 | err = mtd_device_parse_register(info->mtd, pdata->probes, NULL, |
226 | pdata->partitions, pdata->nr_partitions); | 226 | pdata->partitions, |
227 | pdata->nr_partitions); | ||
227 | if (!err) | 228 | if (!err) |
228 | dev_info(&pdev->dev, "registered mtd device\n"); | 229 | dev_info(&pdev->dev, "registered mtd device\n"); |
229 | 230 | ||
diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index 436d121185b1..81884c277405 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c | |||
@@ -98,7 +98,8 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev) | |||
98 | } | 98 | } |
99 | info->mtd->owner = THIS_MODULE; | 99 | info->mtd->owner = THIS_MODULE; |
100 | 100 | ||
101 | mtd_device_parse_register(info->mtd, probes, 0, flash->parts, flash->nr_parts); | 101 | mtd_device_parse_register(info->mtd, probes, NULL, flash->parts, |
102 | flash->nr_parts); | ||
102 | 103 | ||
103 | platform_set_drvdata(pdev, info); | 104 | platform_set_drvdata(pdev, info); |
104 | return 0; | 105 | return 0; |
diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c index 3da63fc6f16e..6f52e1f288b6 100644 --- a/drivers/mtd/maps/rbtx4939-flash.c +++ b/drivers/mtd/maps/rbtx4939-flash.c | |||
@@ -102,8 +102,8 @@ static int rbtx4939_flash_probe(struct platform_device *dev) | |||
102 | info->mtd->owner = THIS_MODULE; | 102 | info->mtd->owner = THIS_MODULE; |
103 | if (err) | 103 | if (err) |
104 | goto err_out; | 104 | goto err_out; |
105 | err = mtd_device_parse_register(info->mtd, NULL, 0, | 105 | err = mtd_device_parse_register(info->mtd, NULL, NULL, pdata->parts, |
106 | pdata->parts, pdata->nr_parts); | 106 | pdata->nr_parts); |
107 | 107 | ||
108 | if (err) | 108 | if (err) |
109 | goto err_out; | 109 | goto err_out; |
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c index cbc3b7867910..a675bdbcb0fe 100644 --- a/drivers/mtd/maps/sa1100-flash.c +++ b/drivers/mtd/maps/sa1100-flash.c | |||
@@ -36,10 +36,22 @@ struct sa_info { | |||
36 | struct sa_subdev_info subdev[0]; | 36 | struct sa_subdev_info subdev[0]; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | static DEFINE_SPINLOCK(sa1100_vpp_lock); | ||
40 | static int sa1100_vpp_refcnt; | ||
39 | static void sa1100_set_vpp(struct map_info *map, int on) | 41 | static void sa1100_set_vpp(struct map_info *map, int on) |
40 | { | 42 | { |
41 | struct sa_subdev_info *subdev = container_of(map, struct sa_subdev_info, map); | 43 | struct sa_subdev_info *subdev = container_of(map, struct sa_subdev_info, map); |
42 | subdev->plat->set_vpp(on); | 44 | unsigned long flags; |
45 | |||
46 | spin_lock_irqsave(&sa1100_vpp_lock, flags); | ||
47 | if (on) { | ||
48 | if (++sa1100_vpp_refcnt == 1) /* first nested 'on' */ | ||
49 | subdev->plat->set_vpp(1); | ||
50 | } else { | ||
51 | if (--sa1100_vpp_refcnt == 0) /* last nested 'off' */ | ||
52 | subdev->plat->set_vpp(0); | ||
53 | } | ||
54 | spin_unlock_irqrestore(&sa1100_vpp_lock, flags); | ||
43 | } | 55 | } |
44 | 56 | ||
45 | static void sa1100_destroy_subdev(struct sa_subdev_info *subdev) | 57 | static void sa1100_destroy_subdev(struct sa_subdev_info *subdev) |
@@ -252,8 +264,8 @@ static int __devinit sa1100_mtd_probe(struct platform_device *pdev) | |||
252 | /* | 264 | /* |
253 | * Partition selection stuff. | 265 | * Partition selection stuff. |
254 | */ | 266 | */ |
255 | mtd_device_parse_register(info->mtd, part_probes, 0, | 267 | mtd_device_parse_register(info->mtd, part_probes, NULL, plat->parts, |
256 | plat->parts, plat->nr_parts); | 268 | plat->nr_parts); |
257 | 269 | ||
258 | platform_set_drvdata(pdev, info); | 270 | platform_set_drvdata(pdev, info); |
259 | err = 0; | 271 | err = 0; |
diff --git a/drivers/mtd/maps/solutionengine.c b/drivers/mtd/maps/solutionengine.c index 496c40704aff..9d900ada6708 100644 --- a/drivers/mtd/maps/solutionengine.c +++ b/drivers/mtd/maps/solutionengine.c | |||
@@ -92,8 +92,8 @@ static int __init init_soleng_maps(void) | |||
92 | mtd_device_register(eprom_mtd, NULL, 0); | 92 | mtd_device_register(eprom_mtd, NULL, 0); |
93 | } | 93 | } |
94 | 94 | ||
95 | mtd_device_parse_register(flash_mtd, probes, 0, | 95 | mtd_device_parse_register(flash_mtd, probes, NULL, |
96 | superh_se_partitions, NUM_PARTITIONS); | 96 | superh_se_partitions, NUM_PARTITIONS); |
97 | 97 | ||
98 | return 0; | 98 | return 0; |
99 | } | 99 | } |
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..2e2b0945edc7 100644 --- a/drivers/mtd/maps/vmu-flash.c +++ b/drivers/mtd/maps/vmu-flash.c | |||
@@ -360,9 +360,6 @@ static int vmu_flash_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
360 | int index = 0, retval, partition, leftover, numblocks; | 360 | int index = 0, retval, partition, leftover, numblocks; |
361 | unsigned char cx; | 361 | unsigned char cx; |
362 | 362 | ||
363 | if (len < 1) | ||
364 | return -EIO; | ||
365 | |||
366 | mpart = mtd->priv; | 363 | mpart = mtd->priv; |
367 | mdev = mpart->mdev; | 364 | mdev = mpart->mdev; |
368 | partition = mpart->partition; | 365 | partition = mpart->partition; |
@@ -434,11 +431,6 @@ static int vmu_flash_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
434 | partition = mpart->partition; | 431 | partition = mpart->partition; |
435 | card = maple_get_drvdata(mdev); | 432 | card = maple_get_drvdata(mdev); |
436 | 433 | ||
437 | /* simple sanity checks */ | ||
438 | if (len < 1) { | ||
439 | error = -EIO; | ||
440 | goto failed; | ||
441 | } | ||
442 | numblocks = card->parts[partition].numblocks; | 434 | numblocks = card->parts[partition].numblocks; |
443 | if (to + len > numblocks * card->blocklen) | 435 | if (to + len > numblocks * card->blocklen) |
444 | len = numblocks * card->blocklen - to; | 436 | len = numblocks * card->blocklen - to; |
@@ -544,9 +536,9 @@ static void vmu_queryblocks(struct mapleq *mq) | |||
544 | mtd_cur->flags = MTD_WRITEABLE|MTD_NO_ERASE; | 536 | mtd_cur->flags = MTD_WRITEABLE|MTD_NO_ERASE; |
545 | mtd_cur->size = part_cur->numblocks * card->blocklen; | 537 | mtd_cur->size = part_cur->numblocks * card->blocklen; |
546 | mtd_cur->erasesize = card->blocklen; | 538 | mtd_cur->erasesize = card->blocklen; |
547 | mtd_cur->write = vmu_flash_write; | 539 | mtd_cur->_write = vmu_flash_write; |
548 | mtd_cur->read = vmu_flash_read; | 540 | mtd_cur->_read = vmu_flash_read; |
549 | mtd_cur->sync = vmu_flash_sync; | 541 | mtd_cur->_sync = vmu_flash_sync; |
550 | mtd_cur->writesize = card->blocklen; | 542 | mtd_cur->writesize = card->blocklen; |
551 | 543 | ||
552 | mpart = kmalloc(sizeof(struct mdev_part), GFP_KERNEL); | 544 | mpart = kmalloc(sizeof(struct mdev_part), GFP_KERNEL); |
diff --git a/drivers/mtd/maps/wr_sbc82xx_flash.c b/drivers/mtd/maps/wr_sbc82xx_flash.c index aa7e0cb2893c..71b0ba797912 100644 --- a/drivers/mtd/maps/wr_sbc82xx_flash.c +++ b/drivers/mtd/maps/wr_sbc82xx_flash.c | |||
@@ -142,7 +142,7 @@ static int __init init_sbc82xx_flash(void) | |||
142 | nr_parts = ARRAY_SIZE(smallflash_parts); | 142 | nr_parts = ARRAY_SIZE(smallflash_parts); |
143 | } | 143 | } |
144 | 144 | ||
145 | mtd_device_parse_register(sbcmtd[i], part_probes, 0, | 145 | mtd_device_parse_register(sbcmtd[i], part_probes, NULL, |
146 | defparts, nr_parts); | 146 | defparts, nr_parts); |
147 | } | 147 | } |
148 | return 0; | 148 | return 0; |