24 #include <linux/module.h>
25 #include <linux/types.h>
27 #include <linux/kernel.h>
28 #include <linux/string.h>
30 #include <linux/device.h>
31 #include <linux/slab.h>
75 (info->
pdata->set_rw)(info->
dev, to);
87 platform_set_drvdata(pdev,
NULL);
133 if (pdev->
dev.platform_data ==
NULL) {
134 dev_err(&pdev->
dev,
"no platform data supplied\n");
139 pdata = pdev->
dev.platform_data;
143 dev_err(&pdev->
dev,
"no memory for flash info\n");
148 platform_set_drvdata(pdev, info);
158 dev_err(&pdev->
dev,
"no memory resource specified\n");
163 dev_dbg(&pdev->
dev,
"got platform resource %p (0x%llx)\n", res,
164 (
unsigned long long)res->
start);
169 info->
map.size = resource_size(res);
178 dev_err(&pdev->
dev,
"failed to request memory region\n");
186 dev_dbg(&pdev->
dev,
"virt %p, %lu bytes\n", info->
map.virt, info->
map.size);
189 dev_err(&pdev->
dev,
"failed to ioremap() region\n");
196 dev_dbg(&pdev->
dev,
"initialised map, probing for mtd\n");
204 for ( ; !info->
mtd && *map_probes; map_probes++)
212 dev_err(&pdev->
dev,
"failed to probe for map_ram\n");
218 info->
mtd->dev.parent = &pdev->
dev;
236 "failed to register the entire device\n");
243 platram_remove(pdev);
254 .probe = platram_probe,
255 .remove = platram_remove,
264 static int __init platram_init(
void)
266 printk(
"Generic platform RAM MTD, (c) 2004 Simtec Electronics\n");
270 static void __exit platram_exit(
void)