kernel: mtdsplit_minor: use -ENOENT instead of -ENODEV
authorChristian Marangi <[email protected]>
Thu, 20 Nov 2025 22:41:30 +0000 (23:41 +0100)
committerChristian Marangi <[email protected]>
Thu, 20 Nov 2025 22:42:12 +0000 (23:42 +0100)
New linux version will check the return code of parser on subpartitions.
The only valid case for skipping a parser with an error is -ENOENT.

Change the relevant entry to -ENOENT.

Signed-off-by: Christian Marangi <[email protected]>
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_minor.c

index f16a00e00e5e4d63d3bbfd5a80644f754668fafa..bf1959f50afcb97cd62fc93744ec623280163341 100644 (file)
@@ -71,17 +71,17 @@ static int mtdsplit_parse_minor(struct mtd_info *master,
 
        /* match header */
        if (hdr.yaffs_type != YAFFS_OBJECT_TYPE_FILE)
-               return -EINVAL;
+               return -ENOENT;
 
        if (hdr.yaffs_obj_id != YAFFS_OBJECTID_ROOT)
-               return -EINVAL;
+               return -ENOENT;
 
        if (hdr.yaffs_sum_unused != YAFFS_SUM_UNUSED)
-               return -EINVAL;
+               return -ENOENT;
 
        if ((memcmp(hdr.yaffs_name, YAFFS_NAME_KERNEL, sizeof(YAFFS_NAME_KERNEL))) &&
            (memcmp(hdr.yaffs_name, YAFFS_NAME_BOOTIMAGE, sizeof(YAFFS_NAME_BOOTIMAGE))))
-               return -EINVAL;
+               return -ENOENT;
 
        err = mtd_find_rootfs_from(master, master->erasesize, master->size,
                                   &rootfs_offset, NULL);