[PATCH 13/23] mtd: add mtd_set_ecclayout() helper function

From: Boris Brezillon
Date: Mon Dec 07 2015 - 17:31:03 EST


Add an mtd_set_ecclayout() helper function to avoid direct accesses to the
mtd->ecclayout field. This will ease future refactor of ECC layout
definition.

Signed-off-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxxxxxxx>
---
include/linux/mtd/mtd.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 25e3d0f..80e32fa 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -253,6 +253,12 @@ struct mtd_info {
int usecount;
};

+static inline void mtd_set_ecclayout(struct mtd_info *mtd,
+ struct nand_ecclayout *ecclayout)
+{
+ mtd->ecclayout = ecclayout;
+}
+
static inline int mtd_eccpos(struct mtd_info *mtd, int eccbyte)
{
if (!mtd->ecclayout)
--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/