diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-04-05 16:28:50 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-04-06 10:48:52 +0200 |
commit | b79ce1382f201bf2e098bafe618a81a4a83e7d1e (patch) | |
tree | a7a64fbd0fae986d48e08c5d7e7cfc97d198205b /common/blspec.c | |
parent | b9abc5322e2a18828fbfab5e081f846f0c4199cc (diff) | |
download | barebox-b79ce1382f201bf2e098bafe618a81a4a83e7d1e.tar.gz barebox-b79ce1382f201bf2e098bafe618a81a4a83e7d1e.tar.xz |
blspec: register as bootentry provider
Instead of using a global function called by
bootentry_create_from_name(), register blspec as bootentry
provider.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/blspec.c')
-rw-r--r-- | common/blspec.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/common/blspec.c b/common/blspec.c index ec63ddb407..8132d141ab 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -732,3 +732,27 @@ int blspec_scan_devicename(struct bootentries *bootentries, const char *devname) return blspec_scan_device(bootentries, dev); } + +static int blspec_bootentry_provider(struct bootentries *bootentries, + const char *name) +{ + int ret, found = 0; + + ret = blspec_scan_devicename(bootentries, name); + if (ret > 0) + found += ret; + + if (*name == '/' || !strncmp(name, "nfs://", 6)) { + ret = blspec_scan_directory(bootentries, name); + if (ret > 0) + found += ret; + } + + return found; +} + +static int blspec_init(void) +{ + return bootentry_register_provider(blspec_bootentry_provider); +} +device_initcall(blspec_init);
\ No newline at end of file |