[openwrt/openwrt] kernel: generic: mtdsplit_seil: return 0 instead of -ENODEV

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 8 12:37:01 PST 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5aab294726f35d8515945484cbee951655cdfe90

commit 5aab294726f35d8515945484cbee951655cdfe90
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Sat Nov 8 14:35:30 2025 +0900

    kernel: generic: mtdsplit_seil: return 0 instead of -ENODEV
    
    Return 0 if the current mtd is inactive or no valid header/rootfs found,
    instead of -ENODEV.
    Linux Kernel 6.7 and later versions handle all errors returned by mtd
    parsers, including -ENODEV as error. So '0' needs to be returned if no
    child partitions were not parsed.
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20697
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seil.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seil.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seil.c
index e58bb49b23..97bee9d268 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seil.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seil.c
@@ -112,7 +112,7 @@ static int mtdsplit_parse_seil_fw(struct mtd_info *master,
 	u64 id;
 
 	if (!seil_bootdev_is_active(np))
-		return -ENODEV;
+		return 0;
 
 	ret = of_property_read_u64(np, "iij,seil-id", &id);
 	if (ret) {
@@ -137,7 +137,7 @@ static int mtdsplit_parse_seil_fw(struct mtd_info *master,
 	if (be64_to_cpu(header.id) != id ||
 	    be32_to_cpu(header.vfmt) != SEIL_VFMT) {
 		pr_debug("no valid seil image found in \"%s\"\n", master->name);
-		ret = -ENODEV;
+		ret = 0;
 		goto err_free_parts;
 	}
 
@@ -154,7 +154,7 @@ static int mtdsplit_parse_seil_fw(struct mtd_info *master,
 	if (ret || (master->size - rootfs_offset) == 0) {
 		pr_debug("no rootfs after seil image in \"%s\"\n",
 			 master->name);
-		ret = -ENODEV;
+		ret = 0;
 		goto err_free_parts;
 	}
 




More information about the lede-commits mailing list