From dfcfb5b831e4e229ec84163a9757250b709274ee Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 8 Mar 2017 10:24:01 +0100 Subject: bbu: Search for cdev names aswell 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 --- common/bbu.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'common/bbu.c') diff --git a/common/bbu.c b/common/bbu.c index c5dda8c8bd..031c433820 100644 --- a/common/bbu.c +++ b/common/bbu.c @@ -109,6 +109,15 @@ static struct bbu_handler *bbu_find_handler_by_device(const char *devicepath) if (!devicepath) return NULL; + list_for_each_entry(handler, &bbu_image_handlers, list) + 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; -- cgit v1.2.3