mtd: add mtd_set_ecclayout() helper function
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Wed, 3 Feb 2016 17:53:44 +0000 (18:53 +0100)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Tue, 19 Apr 2016 20:05:53 +0000 (22:05 +0200)
Add an mtd_set_ecclayout() helper function to avoid direct accesses to the
mtd->ecclayout field. This will ease future reworks of ECC layout
definition.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
include/linux/mtd/mtd.h

index 117ca1ff581db68aa5b776eb45200be1c77071be..e62da8462493edc77dddb016659e5010d978866f 100644 (file)
@@ -286,6 +286,12 @@ int mtd_ooblayout_set_databytes(struct mtd_info *mtd, const u8 *databuf,
 int mtd_ooblayout_count_freebytes(struct mtd_info *mtd);
 int mtd_ooblayout_count_eccbytes(struct mtd_info *mtd);
 
+static inline void mtd_set_ecclayout(struct mtd_info *mtd,
+                                    struct nand_ecclayout *ecclayout)
+{
+       mtd->ecclayout = ecclayout;
+}
+
 static inline void mtd_set_of_node(struct mtd_info *mtd,
                                   struct device_node *np)
 {