int nr_parts;
struct mtd_partition *parts;
#endif
+ unsigned int init_ok;
};
static int rb100_dev_ready(struct mtd_info *mtd)
/* when creating the partitions. */
/*========================================================================*/
-static unsigned init_ok = 0;
unsigned get_rbnand_block_size(struct adm5120_nand_info *data)
{
- return init_ok ? data->mtd.writesize : 0;
+ return data->init_ok ? data->mtd.writesize : 0;
}
EXPORT_SYMBOL(get_rbnand_block_size);
data->mtd.priv = &data->chip;
data->mtd.owner = THIS_MODULE;
+ data->init_ok = 0;
data->chip.IO_ADDR_R = (unsigned char *)KSEG1ADDR(ADM5120_SRAM1_BASE);
data->chip.IO_ADDR_W = data->chip.IO_ADDR_R;
data->chip.cmd_ctrl = rbmips_hwcontrol100;
}
add_mtd_partitions(&data->mtd, partition_info, 2);
- init_ok = 1;
+ data->init_ok = 1;
res = add_mtd_device(&data->mtd);
if (!res)