} 
} else if (machine_is_spitz()) { sharpsl_partition_info[1].size=5 * 1024 * 1024; } else if (machine_is_akita()) { sharpsl_partition_info[1].size=58 * 1024 * 1024; } else if (machine_is_borzoi()) { sharpsl_partition_info[1].size=32 * 1024 * 1024; } 
sharpsl_nand_init(void){	struct nand_chip *this;	struct mtd_partition* sharpsl_partition_info;	int err = 0;	/* Allocate memory for MTD device structure and private data */	sharpsl_mtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip),				GFP_KERNEL);	if (!sharpsl_mtd) {		printk ("Unable to allocate SharpSL NAND MTD device structure.\n");		return -ENOMEM;	}		/* map physical adress */	sharpsl_io_base = ioremap(sharpsl_phys_base, 0x1000);	if(!sharpsl_io_base){		printk("ioremap to access Sharp SL NAND chip failed\n");		kfree(sharpsl_mtd);		return -EIO;	}		/* Get pointer to private data */	this = (struct nand_chip *) (&sharpsl_mtd[1]);	/* Initialize structures */	memset((char *) sharpsl_mtd, 0, sizeof(struct mtd_info));	memset((char *) this, 0, sizeof(struct nand_chip));	/* Link the private data with the MTD structure */	sharpsl_mtd->priv = this;	/*	 * PXA initialize	 */	writeb(readb(FLASHCTL) | FLWP, FLASHCTL);	/* Set address of NAND IO lines */	this->IO_ADDR_R = FLASHIO;	this->IO_ADDR_W = FLASHIO;	/* Set address of hardware control function */	this->hwcontrol = sharpsl_nand_hwcontrol;	this->dev_ready = sharpsl_nand_dev_ready;	/* 15 us command delay time */	this->chip_delay = 15;	/* set eccmode using hardware ECC */	this->eccmode = NAND_ECC_HW3_256;	this->enable_hwecc = sharpsl_nand_enable_hwecc;	this->calculate_ecc = sharpsl_nand_calculate_ecc;	this->correct_data = nand_correct_data;	this->badblock_pattern = &sharpsl_bbt;	/* Scan to find existence of the device */	err=nand_scan(sharpsl_mtd,1);	if (err) {		iounmap(sharpsl_io_base);		kfree(sharpsl_mtd);		return err;	}	/* Register the partitions */	sharpsl_mtd->name = "sharpsl-nand";	nr_partitions = parse_mtd_partitions(sharpsl_mtd, part_probes,						&sharpsl_partition_info, 0);						 	if (nr_partitions <= 0) {		nr_partitions = DEFAULT_NUM_PARTITIONS;		sharpsl_partition_info = sharpsl_nand_default_partition_info;		if (machine_is_poodle()) {			sharpsl_partition_info[1].size=30 * 1024 * 1024;		} else if (machine_is_corgi() || machine_is_shepherd()) {			sharpsl_partition_info[1].size=25 * 1024 * 1024;		} else if (machine_is_husky()) {			sharpsl_partition_info[1].size=53 * 1024 * 1024;		} 			}	if (machine_is_husky()) {		/* Need to use small eraseblock size for backward compatibility */		sharpsl_mtd->flags |= MTD_NO_VIRTBLOCKS;	}	add_mtd_partitions(sharpsl_mtd, sharpsl_partition_info, nr_partitions);	/* Return happy */	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/62052d42a5327281fc43fd7bcfb73ac7d36ffc2e/sharpsl.c/clean/drivers/mtd/nand/sharpsl.c