[PATCH 1/2] bbu: Search for cdev names aswell

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux