diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-08-30 21:45:40 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:28:59 -0400 |
commit | 0612b9ddc2eeda014dd805c87c752b342d8f80f0 (patch) | |
tree | 7691ee548ab6da1e7df946a75abd96a814208d8e /drivers/mtd/mtdchar.c | |
parent | 905c6bcdb42616da717a9bd6c0c5870dbd90b09e (diff) |
mtd: rename MTD_OOB_* to MTD_OPS_*
These modes are not necessarily for OOB only. Particularly, MTD_OOB_RAW
affected operations on in-band page data as well. To clarify these
options and to emphasize that their effect is applied per-operation, we
change the primary prefix to MTD_OPS_.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r-- | drivers/mtd/mtdchar.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index d0eaef67b9bb..9b76438a3c27 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -221,7 +221,7 @@ static ssize_t mtd_read(struct file *file, char __user *buf, size_t count,loff_t | |||
221 | { | 221 | { |
222 | struct mtd_oob_ops ops; | 222 | struct mtd_oob_ops ops; |
223 | 223 | ||
224 | ops.mode = MTD_OOB_RAW; | 224 | ops.mode = MTD_OPS_RAW; |
225 | ops.datbuf = kbuf; | 225 | ops.datbuf = kbuf; |
226 | ops.oobbuf = NULL; | 226 | ops.oobbuf = NULL; |
227 | ops.len = len; | 227 | ops.len = len; |
@@ -317,7 +317,7 @@ static ssize_t mtd_write(struct file *file, const char __user *buf, size_t count | |||
317 | { | 317 | { |
318 | struct mtd_oob_ops ops; | 318 | struct mtd_oob_ops ops; |
319 | 319 | ||
320 | ops.mode = MTD_OOB_RAW; | 320 | ops.mode = MTD_OPS_RAW; |
321 | ops.datbuf = kbuf; | 321 | ops.datbuf = kbuf; |
322 | ops.oobbuf = NULL; | 322 | ops.oobbuf = NULL; |
323 | ops.ooboffs = 0; | 323 | ops.ooboffs = 0; |
@@ -413,7 +413,8 @@ static int mtd_do_writeoob(struct file *file, struct mtd_info *mtd, | |||
413 | ops.ooblen = length; | 413 | ops.ooblen = length; |
414 | ops.ooboffs = start & (mtd->writesize - 1); | 414 | ops.ooboffs = start & (mtd->writesize - 1); |
415 | ops.datbuf = NULL; | 415 | ops.datbuf = NULL; |
416 | ops.mode = (mfi->mode == MTD_MODE_RAW) ? MTD_OOB_RAW : MTD_OOB_PLACE; | 416 | ops.mode = (mfi->mode == MTD_MODE_RAW) ? MTD_OPS_RAW : |
417 | MTD_OPS_PLACE_OOB; | ||
417 | 418 | ||
418 | if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs)) | 419 | if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs)) |
419 | return -EINVAL; | 420 | return -EINVAL; |
@@ -457,7 +458,8 @@ static int mtd_do_readoob(struct file *file, struct mtd_info *mtd, | |||
457 | ops.ooblen = length; | 458 | ops.ooblen = length; |
458 | ops.ooboffs = start & (mtd->writesize - 1); | 459 | ops.ooboffs = start & (mtd->writesize - 1); |
459 | ops.datbuf = NULL; | 460 | ops.datbuf = NULL; |
460 | ops.mode = (mfi->mode == MTD_MODE_RAW) ? MTD_OOB_RAW : MTD_OOB_PLACE; | 461 | ops.mode = (mfi->mode == MTD_MODE_RAW) ? MTD_OPS_RAW : |
462 | MTD_OPS_PLACE_OOB; | ||
461 | 463 | ||
462 | if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs)) | 464 | if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs)) |
463 | return -EINVAL; | 465 | return -EINVAL; |