summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorArtem Bityutskiy2011-12-28 17:35:07 +0100
committerDavid Woodhouse2012-01-09 19:26:08 +0100
commitfc002e3c320602d0e206f607aca0460540d7637a (patch)
tree59a0a24c3f842da192febfcc5de263a339f1dcc5 /include/linux
parentmtd: mtdcore: export symbols cleanup (diff)
downloadkernel-qcow2-linux-fc002e3c320602d0e206f607aca0460540d7637a.tar.gz
kernel-qcow2-linux-fc002e3c320602d0e206f607aca0460540d7637a.tar.xz
kernel-qcow2-linux-fc002e3c320602d0e206f607aca0460540d7637a.zip
mtd: introduce mtd_has_oob helper
We are working in the direction of making sure that MTD clients to not use 'mtd->func' pointers directly. In some places we want to know if OOB operations are supported by an MTD device. Introduce 'mtd_has_oob()' helper for these purposes. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/mtd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index f0dd5a305b89..478701566ba7 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -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;