diff options
author | Florian Fainelli <florian@openwrt.org> | 2007-07-19 12:54:17 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2007-07-19 12:54:17 +0000 |
commit | 925988727e472437879c7643d8d5e7a1b4ea50c9 (patch) | |
tree | 0403de3be7c3c7c93b5dbda3abf8e2c8a5a1775e /target/linux/adm5120-2.6/files/drivers/mtd/nand | |
parent | 980002a679d621bd03d94bf71a43e7305641983a (diff) | |
download | upstream-925988727e472437879c7643d8d5e7a1b4ea50c9.tar.gz upstream-925988727e472437879c7643d8d5e7a1b4ea50c9.tar.bz2 upstream-925988727e472437879c7643d8d5e7a1b4ea50c9.zip |
Put the init flag in the structure
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8054 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/adm5120-2.6/files/drivers/mtd/nand')
-rw-r--r-- | target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c b/target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c index 1c524d40a8..2e7059d186 100644 --- a/target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c +++ b/target/linux/adm5120-2.6/files/drivers/mtd/nand/rbmipsnand.c @@ -67,6 +67,7 @@ struct adm5120_nand_info { int nr_parts; struct mtd_partition *parts; #endif + unsigned int init_ok; }; static int rb100_dev_ready(struct mtd_info *mtd) @@ -93,11 +94,10 @@ static void rbmips_hwcontrol100(struct mtd_info *mtd, int cmd, unsigned int ctrl /* 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); @@ -132,6 +132,7 @@ static int rbmips_probe(struct platform_device *pdev) 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; @@ -151,7 +152,7 @@ static int rbmips_probe(struct platform_device *pdev) } add_mtd_partitions(&data->mtd, partition_info, 2); - init_ok = 1; + data->init_ok = 1; res = add_mtd_device(&data->mtd); if (!res) |