aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdconcat.c
diff options
context:
space:
mode:
authorHolger Brunck <holger.brunck@keymile.com>2011-01-24 11:45:42 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2011-03-11 09:22:42 -0500
commit771df61949cf2d6ae9ff07e209c80693cdbc9302 (patch)
tree58ce33325000bc7c17832c86a2763aabed665b10 /drivers/mtd/mtdconcat.c
parentcbc6c5e73dfa598b1fa5e67cef28096186e2a7cd (diff)
mtd: adapt writebufsize calculation for concat
If different chips with different writebufsize are concatenated, the writebufsize from the concat device has to be taken from the device with the largest writebuffer. This writebufsize is used later on in the UBI layer for the min I/O size. Signed-off-by: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/mtdconcat.c')
-rw-r--r--drivers/mtd/mtdconcat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index 5f5777bd3f75..5060e608ea5d 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -750,6 +750,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
750 struct mtd_concat *concat; 750 struct mtd_concat *concat;
751 uint32_t max_erasesize, curr_erasesize; 751 uint32_t max_erasesize, curr_erasesize;
752 int num_erase_region; 752 int num_erase_region;
753 int max_writebufsize = 0;
753 754
754 printk(KERN_NOTICE "Concatenating MTD devices:\n"); 755 printk(KERN_NOTICE "Concatenating MTD devices:\n");
755 for (i = 0; i < num_devs; i++) 756 for (i = 0; i < num_devs; i++)
@@ -776,7 +777,12 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
776 concat->mtd.size = subdev[0]->size; 777 concat->mtd.size = subdev[0]->size;
777 concat->mtd.erasesize = subdev[0]->erasesize; 778 concat->mtd.erasesize = subdev[0]->erasesize;
778 concat->mtd.writesize = subdev[0]->writesize; 779 concat->mtd.writesize = subdev[0]->writesize;
779 concat->mtd.writebufsize = subdev[0]->writebufsize; 780
781 for (i = 0; i < num_devs; i++)
782 if (max_writebufsize < subdev[i]->writebufsize)
783 max_writebufsize = subdev[i]->writebufsize;
784 concat->mtd.writebufsize = max_writebufsize;
785
780 concat->mtd.subpage_sft = subdev[0]->subpage_sft; 786 concat->mtd.subpage_sft = subdev[0]->subpage_sft;
781 concat->mtd.oobsize = subdev[0]->oobsize; 787 concat->mtd.oobsize = subdev[0]->oobsize;
782 concat->mtd.oobavail = subdev[0]->oobavail; 788 concat->mtd.oobavail = subdev[0]->oobavail;