info->map.map_priv_1 = ioremap(dev->resource->start, 
info->map.map_priv_1 = (unsigned long) ioremap(dev->resource->start, 
static int ixp2000_flash_probe(struct device *_dev){	static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };	struct platform_device *dev = to_platform_device(_dev);	struct ixp2000_flash_data *ixp_data = dev->dev.platform_data;	struct flash_platform_data *plat; 	struct ixp2000_flash_info *info;	unsigned long window_size;	int err = -1;		if (!ixp_data)		return -ENODEV;	plat = ixp_data->platform_data;	if (!plat)		return -ENODEV;	window_size = dev->resource->end - dev->resource->start + 1;	dev_info(_dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n", 			ixp_data->nr_banks, ((u32)window_size >> 20));	if (plat->width != 1) {		dev_err(_dev, "IXP2000 MTD map only supports 8-bit mode, asking for %d\n",				plat->width * 8);		return -EIO;	}	info = kmalloc(sizeof(struct ixp2000_flash_info), GFP_KERNEL);	if(!info) {		err = -ENOMEM;		goto Error;	}		memzero(info, sizeof(struct ixp2000_flash_info));	dev_set_drvdata(&dev->dev, info);	/*	 * Tell the MTD layer we're not 1:1 mapped so that it does	 * not attempt to do a direct access on us.	 */	info->map.phys = NO_XIP;		info->nr_banks = ixp_data->nr_banks;	info->map.size = ixp_data->nr_banks * window_size;	info->map.bankwidth = 1;	/* 	 * map_priv_2 is used to store a ptr to to the bank_setup routine 	 */	info->map.map_priv_2 = (void __iomem *) ixp_data->bank_setup;	info->map.name = dev->dev.bus_id;	info->map.read = ixp2000_flash_read8;	info->map.write = ixp2000_flash_write8;	info->map.copy_from = ixp2000_flash_copy_from;	info->map.copy_to = ixp2000_flash_copy_to;	info->res = request_mem_region(dev->resource->start, 			dev->resource->end - dev->resource->start + 1, 			dev->dev.bus_id);	if (!info->res) {		dev_err(_dev, "Could not reserve memory region\n");		err = -ENOMEM;		goto Error;	}	info->map.map_priv_1 = ioremap(dev->resource->start, 			    	dev->resource->end - dev->resource->start + 1);	if (!info->map.map_priv_1) {		dev_err(_dev, "Failed to ioremap flash region\n");		err = -EIO;		goto Error;	}#if defined(__ARMEB__)	/*	 * Enable erratum 44 workaround for NPUs with broken slowport	 */	erratum44_workaround = ixp2000_has_broken_slowport();	dev_info(_dev, "Erratum 44 workaround %s\n",	       erratum44_workaround ? "enabled" : "disabled");#endif	info->mtd = do_map_probe(plat->map_name, &info->map);	if (!info->mtd) {		dev_err(_dev, "map_probe failed\n");		err = -ENXIO;		goto Error;	}	info->mtd->owner = THIS_MODULE;	err = parse_mtd_partitions(info->mtd, probes, &info->partitions, 0);	if (err > 0) {		err = add_mtd_partitions(info->mtd, info->partitions, err);		if(err)			dev_err(_dev, "Could not parse partitions\n");	}	if (err)		goto Error;	return 0;Error:	ixp2000_flash_remove(_dev);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/ea17629f3e6f64591a98a9049a0d725d2672509c/ixp2000.c/clean/drivers/mtd/maps/ixp2000.c