Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282903
b: refs/heads/master
c: 1093447
h: refs/heads/master
i:
  282901: ff178c0
  282899: 480b4d1
  282895: 42d98c1
v: v3
  • Loading branch information
Artem Bityutskiy authored and David Woodhouse committed Jan 9, 2012
1 parent 9237354 commit cda5550
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc002e3c320602d0e206f607aca0460540d7637a
refs/heads/master: 10934478e44d9a5a7b16dadd89094fb608cf101e
9 changes: 4 additions & 5 deletions trunk/fs/jffs2/erase.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,11 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
uint32_t ofs;
size_t retlen;
int ret = -EIO;
unsigned long *wordebuf;

if (c->mtd->point) {
unsigned long *wordebuf;

ret = mtd_point(c->mtd, jeb->offset, c->sector_size, &retlen,
&ebuf, NULL);
ret = mtd_point(c->mtd, jeb->offset, c->sector_size, &retlen,
&ebuf, NULL);
if (ret != -EOPNOTSUPP) {
if (ret) {
D1(printk(KERN_DEBUG "MTD point failed %d\n", ret));
goto do_flash_read;
Expand Down
18 changes: 8 additions & 10 deletions trunk/fs/jffs2/readinode.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,15 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
#ifndef __ECOS
/* TODO: instead, incapsulate point() stuff to jffs2_flash_read(),
* adding and jffs2_flash_read_end() interface. */
if (c->mtd->point) {
err = mtd_point(c->mtd, ofs, len, &retlen, (void **)&buffer,
NULL);
if (!err && retlen < len) {
JFFS2_WARNING("MTD point returned len too short: %zu instead of %u.\n", retlen, tn->csize);
mtd_unpoint(c->mtd, ofs, retlen);
} else if (err)
err = mtd_point(c->mtd, ofs, len, &retlen, (void **)&buffer, NULL);
if (!err && retlen < len) {
JFFS2_WARNING("MTD point returned len too short: %zu instead of %u.\n", retlen, tn->csize);
mtd_unpoint(c->mtd, ofs, retlen);
} else if (err) {
if (err != -EOPNOTSUPP)
JFFS2_WARNING("MTD point failed: error code %d.\n", err);
else
pointed = 1; /* succefully pointed to device */
}
} else
pointed = 1; /* succefully pointed to device */
#endif

if (!pointed) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/jffs2/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
mtd_unpoint(c->mtd, 0, pointlen);
flashbuf = NULL;
}
if (ret)
if (ret && ret != -EOPNOTSUPP)
D1(printk(KERN_DEBUG "MTD point failed %d\n", ret));
}
#endif
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/mtd/mtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ static inline int mtd_point(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, void **virt, resource_size_t *phys)
{
*retlen = 0;
if (!mtd->point)
return -EOPNOTSUPP;
return mtd->point(mtd, from, len, retlen, virt, phys);
}

Expand Down

0 comments on commit cda5550

Please sign in to comment.