summaryrefslogtreecommitdiffstats
path: root/common/bbu.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-08 10:24:01 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-10 08:28:10 +0100
commitdfcfb5b831e4e229ec84163a9757250b709274ee (patch)
treeed2e2b6ec2ca655ffe0b2f04b9717f3f0a864f21 /common/bbu.c
parentbe0c9a3fadedcb784c32fcc6a583e7308b9c76ae (diff)
downloadbarebox-dfcfb5b831e4e229ec84163a9757250b709274ee.tar.gz
barebox-dfcfb5b831e4e229ec84163a9757250b709274ee.tar.xz
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>
Diffstat (limited to 'common/bbu.c')
-rw-r--r--common/bbu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/bbu.c b/common/bbu.c
index c5dda8c8bd..031c433820 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;
}