From e1491b341b212000bc26f68b55d9a060b9c48625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 1 Feb 2016 12:41:41 +0000 Subject: kernel: mtdsplit: modify rootfs helpers to provide partition type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our mtdsplit parsers may want to create partition with name choice based on partition file system (e.g. SquashFS vs. JFFS2). This patch allows passing extra argument pointing to variable that will be set properly. Signed-off-by: Rafał Miłecki SVN-Revision: 48598 --- .../generic/files/drivers/mtd/mtdsplit/mtdsplit.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit.h') diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit.h b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit.h index 7ee88b0bb4..b757758685 100644 --- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit.h +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit.h @@ -18,17 +18,25 @@ #define ROOTFS_SPLIT_NAME "rootfs_data" +enum mtdsplit_part_type { + MTDSPLIT_PART_TYPE_UNK = 0, + MTDSPLIT_PART_TYPE_SQUASHFS, + MTDSPLIT_PART_TYPE_JFFS2, +}; + #ifdef CONFIG_MTD_SPLIT int mtd_get_squashfs_len(struct mtd_info *master, size_t offset, size_t *squashfs_len); -int mtd_check_rootfs_magic(struct mtd_info *mtd, size_t offset); +int mtd_check_rootfs_magic(struct mtd_info *mtd, size_t offset, + enum mtdsplit_part_type *type); int mtd_find_rootfs_from(struct mtd_info *mtd, size_t from, size_t limit, - size_t *ret_offset); + size_t *ret_offset, + enum mtdsplit_part_type *type); #else static inline int mtd_get_squashfs_len(struct mtd_info *master, @@ -38,7 +46,8 @@ static inline int mtd_get_squashfs_len(struct mtd_info *master, return -ENODEV; } -static inline int mtd_check_rootfs_magic(struct mtd_info *mtd, size_t offset) +static inline int mtd_check_rootfs_magic(struct mtd_info *mtd, size_t offset, + enum mtdsplit_part_type *type) { return -EINVAL; } @@ -46,7 +55,8 @@ static inline int mtd_check_rootfs_magic(struct mtd_info *mtd, size_t offset) static inline int mtd_find_rootfs_from(struct mtd_info *mtd, size_t from, size_t limit, - size_t *ret_offset) + size_t *ret_offset, + enum mtdsplit_part_type *type) { return -ENODEV; } -- cgit v1.2.3