dev_dbg(dev, "virt %p, %d bytes\n", info->map.virt, info->map.size); 
dev_dbg(dev, "virt %p, %lu bytes\n", info->map.virt, info->map.size); 
static int platram_probe(struct device *dev){	struct platform_device *pd = to_platform_device(dev);	struct platdata_mtd_ram	*pdata;	struct platram_info *info;	struct resource *res;	int err = 0;	dev_dbg(dev, "probe entered\n");		if (dev->platform_data == NULL) {		dev_err(dev, "no platform data supplied\n");		err = -ENOENT;		goto exit_error;	}	pdata = dev->platform_data;	info = kmalloc(sizeof(*info), GFP_KERNEL);	if (info == NULL) {		dev_err(dev, "no memory for flash info\n");		err = -ENOMEM;		goto exit_error;	}	memzero(info, sizeof(*info));	dev_set_drvdata(dev, info);	info->dev = dev;	info->pdata = pdata;	/* get the resource for the memory mapping */	res = platform_get_resource(pd, IORESOURCE_MEM, 0);	if (res == NULL) {		dev_err(dev, "no memory resource specified\n");		err = -ENOENT;		goto exit_free;	}	dev_dbg(dev, "got platform resource %p (0x%lx)\n", res, res->start);	/* setup map parameters */	info->map.phys = res->start;	info->map.size = (res->end - res->start) + 1;	info->map.name = pdata->mapname != NULL ? pdata->mapname : pd->name;	info->map.bankwidth = pdata->bankwidth;	/* register our usage of the memory area */	info->area = request_mem_region(res->start, info->map.size, pd->name);	if (info->area == NULL) {		dev_err(dev, "failed to request memory region\n");		err = -EIO;		goto exit_free;	}	/* remap the memory area */	info->map.virt = ioremap(res->start, info->map.size);	dev_dbg(dev, "virt %p, %d bytes\n", info->map.virt, info->map.size);	if (info->map.virt == NULL) {		dev_err(dev, "failed to ioremap() region\n");		err = -EIO;		goto exit_free;	}	{		unsigned int *p = (unsigned int *)info->map.virt;		printk("%08x %08x %08x %08x\n",		       readl(p), readl(p+1), readl(p+2), readl(p+3));	}	simple_map_init(&info->map);	dev_dbg(dev, "initialised map, probing for mtd\n");	/* probe for the right mtd map driver */	info->mtd = do_map_probe("map_ram" , &info->map);	if (info->mtd == NULL) {		dev_err(dev, "failed to probe for map_ram\n");		err = -ENOMEM;		goto exit_free;	}	info->mtd->owner = THIS_MODULE;	platram_setrw(info, PLATRAM_RW);	/* check to see if there are any available partitions, or wether	 * to add this device whole */#ifdef CONFIG_MTD_PARTITIONS	if (pdata->nr_partitions > 0) {		const char **probes = { NULL };		if (pdata->probes)			probes = (const char **)pdata->probes;		err = parse_mtd_partitions(info->mtd, probes,					   &info->partitions, 0);		if (err > 0) {			err = add_mtd_partitions(info->mtd, info->partitions,						 err);		}	}#endif /* CONFIG_MTD_PARTITIONS */	if (add_mtd_device(info->mtd)) {		dev_err(dev, "add_mtd_device() failed\n");		err = -ENOMEM;	}		dev_info(dev, "registered mtd device\n");	return err; exit_free:	platram_remove(dev); exit_error:	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/fb6bb52ddde0429b654ab6d4cb20fa016a1d5b0d/plat-ram.c/buggy/drivers/mtd/maps/plat-ram.c