mtdpart.c (05668381140309088443bf5dc53add4104610fbb) mtdpart.c (7014568bad55c20b7ee4f439d78c9e875912d51f)
1/*
2 * Simple MTD partitioning layer
3 *
4 * (C) 2000 Nicolas Pitre <nico@cam.org>
5 *
6 * This code is GPL
7 *
8 * $Id: mtdpart.c,v 1.55 2005/11/07 11:14:20 gleixner Exp $

--- 80 unchanged lines hidden (view full) ---

89static int part_read_oob(struct mtd_info *mtd, loff_t from,
90 struct mtd_oob_ops *ops)
91{
92 struct mtd_part *part = PART(mtd);
93 int res;
94
95 if (from >= mtd->size)
96 return -EINVAL;
1/*
2 * Simple MTD partitioning layer
3 *
4 * (C) 2000 Nicolas Pitre <nico@cam.org>
5 *
6 * This code is GPL
7 *
8 * $Id: mtdpart.c,v 1.55 2005/11/07 11:14:20 gleixner Exp $

--- 80 unchanged lines hidden (view full) ---

89static int part_read_oob(struct mtd_info *mtd, loff_t from,
90 struct mtd_oob_ops *ops)
91{
92 struct mtd_part *part = PART(mtd);
93 int res;
94
95 if (from >= mtd->size)
96 return -EINVAL;
97 if (from + ops->len > mtd->size)
97 if (ops->datbuf && from + ops->len > mtd->size)
98 return -EINVAL;
99 res = part->master->read_oob(part->master, from + part->offset, ops);
100
101 if (unlikely(res)) {
102 if (res == -EUCLEAN)
103 mtd->ecc_stats.corrected++;
104 if (res == -EBADMSG)
105 mtd->ecc_stats.failed++;

--- 50 unchanged lines hidden (view full) ---

156{
157 struct mtd_part *part = PART(mtd);
158
159 if (!(mtd->flags & MTD_WRITEABLE))
160 return -EROFS;
161
162 if (to >= mtd->size)
163 return -EINVAL;
98 return -EINVAL;
99 res = part->master->read_oob(part->master, from + part->offset, ops);
100
101 if (unlikely(res)) {
102 if (res == -EUCLEAN)
103 mtd->ecc_stats.corrected++;
104 if (res == -EBADMSG)
105 mtd->ecc_stats.failed++;

--- 50 unchanged lines hidden (view full) ---

156{
157 struct mtd_part *part = PART(mtd);
158
159 if (!(mtd->flags & MTD_WRITEABLE))
160 return -EROFS;
161
162 if (to >= mtd->size)
163 return -EINVAL;
164 if (to + ops->len > mtd->size)
164 if (ops->datbuf && to + ops->len > mtd->size)
165 return -EINVAL;
166 return part->master->write_oob(part->master, to + part->offset, ops);
167}
168
169static int part_write_user_prot_reg (struct mtd_info *mtd, loff_t from, size_t len,
170 size_t *retlen, u_char *buf)
171{
172 struct mtd_part *part = PART(mtd);

--- 392 unchanged lines hidden ---
165 return -EINVAL;
166 return part->master->write_oob(part->master, to + part->offset, ops);
167}
168
169static int part_write_user_prot_reg (struct mtd_info *mtd, loff_t from, size_t len,
170 size_t *retlen, u_char *buf)
171{
172 struct mtd_part *part = PART(mtd);

--- 392 unchanged lines hidden ---