Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282907
b: refs/heads/master
c: dac2639
h: refs/heads/master
i:
  282905: 0761453
  282903: cda5550
v: v3
  • Loading branch information
Artem Bityutskiy authored and David Woodhouse committed Jan 9, 2012
1 parent a1ef4a3 commit 603f556
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 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: 016c1291ce70a22f15f666441a4fd2f0b450375b
refs/heads/master: dac2639f9833e858139d7e07f6ee45fb2191a9f2
9 changes: 2 additions & 7 deletions trunk/drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,8 @@ static int mtdchar_readoob(struct file *file, struct mtd_info *mtd,
if (length > 4096)
return -EINVAL;

if (!mtd->read_oob)
ret = -EOPNOTSUPP;
else
ret = access_ok(VERIFY_WRITE, ptr,
length) ? 0 : -EFAULT;
if (ret)
return ret;
if (!access_ok(VERIFY_WRITE, ptr, length))
return -EFAULT;

ops.ooblen = length;
ops.ooboffs = start & (mtd->writesize - 1);
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/mtd/mtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,17 @@ static inline int mtd_read_oob(struct mtd_info *mtd, loff_t from,
struct mtd_oob_ops *ops)
{
ops->retlen = ops->oobretlen = 0;
if (!mtd->read_oob)
return -EOPNOTSUPP;
return mtd->read_oob(mtd, from, ops);
}

static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to,
struct mtd_oob_ops *ops)
{
ops->retlen = ops->oobretlen = 0;
if (!mtd->write_oob)
return -EOPNOTSUPP;
return mtd->write_oob(mtd, to, ops);
}

Expand Down

0 comments on commit 603f556

Please sign in to comment.