From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd: mtdparts: Probe MTD devices in mtdparts_init()
Date: Tue, 30 Oct 2018 10:51:51 +0100 [thread overview]
Message-ID: <20181030095151.12442-1-sr@denx.de> (raw)
Calling "mtdparts" currently fails when its called before any other mtd
command (or ubi command) has been called. The MTD devices are not
probed at this point and therefore it fails e.g. with this message:
=> mtdparts
Device spi-nand0 not found!
This patch adds a call to mtd_probe_devices() to mtdparts_init() to
solve this issue. This also fixes a problem when calling "ubi part"
as first flash storage related command. Here also the warning from
above is printed without this patch.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Jagan Teki <jagan@openedev.com>
---
cmd/mtdparts.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c
index f7ed1a0779..d90e568143 100644
--- a/cmd/mtdparts.c
+++ b/cmd/mtdparts.c
@@ -73,6 +73,7 @@
#include <common.h>
#include <command.h>
#include <malloc.h>
+#include <mtd.h>
#include <jffs2/load_kernel.h>
#include <linux/list.h>
#include <linux/ctype.h>
@@ -1726,6 +1727,9 @@ int mtdparts_init(void)
char tmp_ep[PARTITION_MAXLEN + 1];
char tmp_parts[MTDPARTS_MAXLEN];
+ /* First probe all MTD devices */
+ mtd_probe_devices();
+
debug("\n---mtdparts_init---\n");
if (!initialized) {
INIT_LIST_HEAD(&mtdids);
--
2.19.1
next reply other threads:[~2018-10-30 9:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 9:51 Stefan Roese [this message]
2018-10-30 10:03 ` [U-Boot] [PATCH] cmd: mtdparts: Probe MTD devices in mtdparts_init() Boris Brezillon
2018-10-30 10:13 ` Stefan Roese
2018-10-30 10:41 ` Boris Brezillon
2018-10-30 10:59 ` Stefan Roese
2018-10-30 13:46 ` Boris Brezillon
2018-10-30 22:02 ` Boris Brezillon
2018-10-30 22:43 ` Boris Brezillon
2018-10-31 6:05 ` Stefan Roese
2018-10-30 22:43 ` Miquel Raynal
2018-10-30 22:49 ` Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181030095151.12442-1-sr@denx.de \
--to=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox