Parsing of dfu_alt_info depends on matching MTD device names, so it is necessary for all MTD devices to be probed first.
This fixes a failure of the "dfu usb" command that occurs when: - dfu_alt_info contains SF devices listed as via MTD - there is no persistent environment stored in SF - "sf probe" has not been executed prior to "dfu usb" Reviewed-by: Mattijs Korpershoek <[email protected]> Signed-off-by: Ralph Siemsen <[email protected]> --- Changes in v2: - Add R-b tag - Rebase to 2026.19-rc4 - Link to v1: https://patch.msgid.link/[email protected] --- drivers/dfu/dfu_mtd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c index c36ac09189f..da19bc21492 100644 --- a/drivers/dfu/dfu_mtd.c +++ b/drivers/dfu/dfu_mtd.c @@ -289,6 +289,9 @@ int dfu_fill_entity_mtd(struct dfu_entity *dfu, char *devstr, char **argv, int a struct mtd_info *mtd; int part; + /* register partitions with MTDIDS/MTDPARTS or OF fallback */ + mtd_probe_devices(); + mtd = get_mtd_device_nm(devstr); if (IS_ERR_OR_NULL(mtd)) return -ENODEV; @@ -324,9 +327,6 @@ int dfu_fill_entity_mtd(struct dfu_entity *dfu, char *devstr, char **argv, int a if (*s) return -EINVAL; - /* register partitions with MTDIDS/MTDPARTS or OF fallback */ - mtd_probe_devices(); - partnum = 0; list_for_each_entry(partition, &mtd->partitions, node) { partnum++; --- base-commit: b4ac71db13a33c4e6532c60a781ddf34b7f4375a change-id: 20260901-rzn1-2026-10-mtd-856065fbc00c Best regards, -- Ralph Siemsen <[email protected]>
