diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 17:30:16 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 18:25:19 +0000 |
commit | 329ad399a9b3adf52c90637b21ca029fcf7f8795 (patch) | |
tree | 7aa7bb2609c25de7859c3a666f3ea90934609592 /drivers/mtd/ar7part.c | |
parent | 04c601bfa4cb29c968dcb66e44c799c9c01d8675 (diff) |
mtd: introduce mtd_read interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/ar7part.c')
-rw-r--r-- | drivers/mtd/ar7part.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/mtd/ar7part.c b/drivers/mtd/ar7part.c index f40ea454755..94539312995 100644 --- a/drivers/mtd/ar7part.c +++ b/drivers/mtd/ar7part.c @@ -73,8 +73,8 @@ static int create_mtd_partitions(struct mtd_info *master, do { /* Try 10 blocks starting from master->erasesize */ offset = pre_size; - master->read(master, offset, - sizeof(header), &len, (uint8_t *)&header); + mtd_read(master, offset, sizeof(header), &len, + (uint8_t *)&header); if (!strncmp((char *)&header, "TIENV0.8", 8)) ar7_parts[1].offset = pre_size; if (header.checksum == LOADER_MAGIC1) @@ -95,16 +95,16 @@ static int create_mtd_partitions(struct mtd_info *master, case LOADER_MAGIC1: while (header.length) { offset += sizeof(header) + header.length; - master->read(master, offset, sizeof(header), - &len, (uint8_t *)&header); + mtd_read(master, offset, sizeof(header), &len, + (uint8_t *)&header); } root_offset = offset + sizeof(header) + 4; break; case LOADER_MAGIC2: while (header.length) { offset += sizeof(header) + header.length; - master->read(master, offset, sizeof(header), - &len, (uint8_t *)&header); + mtd_read(master, offset, sizeof(header), &len, + (uint8_t *)&header); } root_offset = offset + sizeof(header) + 4 + 0xff; root_offset &= ~(uint32_t)0xff; @@ -114,8 +114,7 @@ static int create_mtd_partitions(struct mtd_info *master, break; } - master->read(master, root_offset, - sizeof(header), &len, (u8 *)&header); + mtd_read(master, root_offset, sizeof(header), &len, (u8 *)&header); if (header.checksum != SQUASHFS_MAGIC) { root_offset += master->erasesize - 1; root_offset &= ~(master->erasesize - 1); |