Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282902
b: refs/heads/master
c: fc002e3
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and David Woodhouse committed Jan 9, 2012
1 parent ff178c0 commit 9237354
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 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: 33c87b4a2c820316314542ce3f60b8a8c6a96928
refs/heads/master: fc002e3c320602d0e206f607aca0460540d7637a
2 changes: 1 addition & 1 deletion trunk/drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
break;

case MTD_FILE_MODE_RAW:
if (!mtd->read_oob || !mtd->write_oob)
if (!mtd_has_oob(mtd))
return -EOPNOTSUPP;
mfi->mode = arg;

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/mtd/sm_ftl.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ int sm_get_media_info(struct sm_ftl *ftl, struct mtd_info *mtd)
if (!ftl->smallpagenand && mtd->oobsize < SM_OOB_SIZE)
return -ENODEV;

/* We use these functions for IO */
if (!mtd->read_oob || !mtd->write_oob)
/* We use OOB */
if (!mtd_has_oob(mtd))
return -ENODEV;

/* Find geometry information */
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/mtd/mtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd)
return do_div(sz, mtd->writesize);
}

static inline int mtd_has_oob(const struct mtd_info *mtd)
{
return mtd->read_oob && mtd->write_oob;
}

/* Kernel-side ioctl definitions */

struct mtd_partition;
Expand Down

0 comments on commit 9237354

Please sign in to comment.