diff options
author | Richard Purdie <rpurdie@openedhand.com> | 2006-10-27 09:09:33 +0100 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-11-28 22:27:47 +0000 |
commit | 191876729901d0c8dab8a331f9a1e4b73a56457b (patch) | |
tree | 1e25eb24ac84c09b0300e32eea55b33adc567015 /drivers/mtd/mtdblock_ro.c | |
parent | 90afffc8bd79d130b58acd18f972ce4e00b8e20f (diff) | |
download | blackbird-op-linux-191876729901d0c8dab8a331f9a1e4b73a56457b.tar.gz blackbird-op-linux-191876729901d0c8dab8a331f9a1e4b73a56457b.zip |
[MTD] Allow variable block sizes in mtd_blkdevs
Currently, mtd_blkdevs enforces a block size of 512, even if the drivers
can seemingly request a different size. This patch fixes mtd_blkdevs so
block sizes other than 512 work correctly.
Signed-off-by: Richard Purdie <rpurdie@openedhand.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/mtdblock_ro.c')
-rw-r--r-- | drivers/mtd/mtdblock_ro.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/mtdblock_ro.c b/drivers/mtd/mtdblock_ro.c index 29563ed258a4..642ccc66f283 100644 --- a/drivers/mtd/mtdblock_ro.c +++ b/drivers/mtd/mtdblock_ro.c @@ -42,7 +42,7 @@ static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) dev->mtd = mtd; dev->devnum = mtd->index; - dev->blksize = 512; + dev->size = mtd->size >> 9; dev->tr = tr; dev->readonly = 1; @@ -60,6 +60,7 @@ static struct mtd_blktrans_ops mtdblock_tr = { .name = "mtdblock", .major = 31, .part_bits = 0, + .blksize = 512, .readsect = mtdblock_readsect, .writesect = mtdblock_writesect, .add_mtd = mtdblock_add_mtd, |