From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/4] UBI: Add ubidetach command
Date: Tue, 23 Jul 2013 12:27:59 +0200 [thread overview]
Message-ID: <1374575282-9592-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1374575282-9592-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
commands/ubi.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/commands/ubi.c b/commands/ubi.c
index 7348394..854ea83 100644
--- a/commands/ubi.c
+++ b/commands/ubi.c
@@ -92,6 +92,32 @@ BAREBOX_CMD_START(ubiattach)
BAREBOX_CMD_HELP(cmd_ubiattach_help)
BAREBOX_CMD_END
+static int do_ubidetach(int argc, char *argv[])
+{
+ int ubi_num, ret;
+
+ if (argc != 2)
+ return COMMAND_ERROR_USAGE;
+
+ ubi_num = simple_strtoul(argv[1], NULL, 0);
+ ret = ubi_detach_mtd_dev(ubi_num, 1);
+
+ if (ret)
+ printf("failed to detach: %s\n", strerror(-ret));
+
+ return ret;
+}
+
+static const __maybe_unused char cmd_ubidetach_help[] =
+"Usage: ubidetach <ubinum>\n"
+"Detach <ubinum> from ubi\n";
+
+BAREBOX_CMD_START(ubidetach)
+ .cmd = do_ubidetach,
+ .usage = "detach an ubi dev",
+ BAREBOX_CMD_HELP(cmd_ubidetach_help)
+BAREBOX_CMD_END
+
static int do_ubirmvol(int argc, char *argv[])
{
struct ubi_mkvol_req req;
--
1.8.3.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-07-23 10:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 10:27 [PATCH] update UBI support Sascha Hauer
2013-07-23 10:27 ` Sascha Hauer [this message]
2013-07-23 10:28 ` [PATCH 2/4] ubiattach command: Properly check return values Sascha Hauer
2013-07-23 10:28 ` [PATCH 3/4] UBI: remove old ubi support Sascha Hauer
2013-07-23 10:28 ` [PATCH 4/4] UBI: reimport UBI from Linux v3.10 Sascha Hauer
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=1374575282-9592-2-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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