summaryrefslogtreecommitdiff
path: root/drivers/mtd/mtd_uboot.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-10-12 18:54:13 +0300
committerTom Rini <trini@konsulko.com>2018-10-12 18:54:13 +0300
commite6cd05e5025bbab9723bbb09c506cbb5aa63bc53 (patch)
tree86b04c08de25b78711171da16ed7e4447588d1b6 /drivers/mtd/mtd_uboot.c
parent15f22ac2eea5ee9f17b14a143c94e7480bbafbff (diff)
parent5c391486b411025785e064f160d248bef31b3d28 (diff)
downloadu-boot-e6cd05e5025bbab9723bbb09c506cbb5aa63bc53.tar.xz
Merge branch 'master' of git://git.denx.de/u-boot-spi
Diffstat (limited to 'drivers/mtd/mtd_uboot.c')
-rw-r--r--drivers/mtd/mtd_uboot.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mtd/mtd_uboot.c b/drivers/mtd/mtd_uboot.c
index 6a211d52ff..7d7a11c990 100644
--- a/drivers/mtd/mtd_uboot.c
+++ b/drivers/mtd/mtd_uboot.c
@@ -104,7 +104,10 @@ int mtd_probe_devices(void)
mtd_probe_uclass_mtd_devs();
/* Check if mtdparts/mtdids changed since last call, otherwise: exit */
- if (!strcmp(mtdparts, old_mtdparts) && !strcmp(mtdids, old_mtdids))
+ if ((!mtdparts && !old_mtdparts && !mtdids && !old_mtdids) ||
+ (mtdparts && old_mtdparts && mtdids && old_mtdids &&
+ !strcmp(mtdparts, old_mtdparts) &&
+ !strcmp(mtdids, old_mtdids)))
return 0;
/* Update the local copy of mtdparts */
@@ -140,6 +143,10 @@ int mtd_probe_devices(void)
}
}
+ /* If either mtdparts or mtdids is empty, then exit */
+ if (!mtdparts || !mtdids)
+ return 0;
+
/* Start the parsing by ignoring the extra 'mtdparts=' prefix, if any */
if (strstr(mtdparts, "mtdparts="))
mtdparts += 9;