9
0
Fork 0

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 <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2017-03-08 10:24:01 +01:00
parent be0c9a3fad
commit dfcfb5b831
1 changed files with 9 additions and 0 deletions

View File

@ -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;