From: Oleksij Rempel <o.rempel@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] bbu: Search for cdev names aswell
Date: Wed, 8 Mar 2017 10:24:01 +0100 [thread overview]
Message-ID: <20170308092402.21245-1-o.rempel@pengutronix.de> (raw)
From: Sascha Hauer <s.hauer@pengutronix.de>
In bbu_find_handler_by_device() search for cdev names aswell since some
update handlers are registered with their cdev name and not the full
path.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/bbu.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/common/bbu.c b/common/bbu.c
index c5dda8c8b..031c43382 100644
--- a/common/bbu.c
+++ b/common/bbu.c
@@ -113,6 +113,15 @@ static struct bbu_handler *bbu_find_handler_by_device(const char *devicepath)
if (!strcmp(handler->devicefile, devicepath))
return handler;
+ if (strncmp(devicepath, "/dev/", 5))
+ return NULL;
+
+ devicepath += 5;
+
+ list_for_each_entry(handler, &bbu_image_handlers, list)
+ if (!strcmp(handler->devicefile, devicepath))
+ return handler;
+
return NULL;
}
--
2.11.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2017-03-08 9:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 9:24 Oleksij Rempel [this message]
2017-03-08 9:24 ` [PATCH 2/2] usb: fastboot: umount device before writing to it Oleksij Rempel
2017-03-10 7:32 ` Sascha Hauer
2017-03-10 9:14 ` Oleksij Rempel
2017-03-10 9:17 ` 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=20170308092402.21245-1-o.rempel@pengutronix.de \
--to=o.rempel@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