Skip to content
Snippets Groups Projects
Commit 5d81c6df authored by Emmanuel Vadot's avatar Emmanuel Vadot Committed by Tom Rini
Browse files

api: storage: Avoid enumeration for non-configured subsystem


If a subsystem wasn't configured, avoid enumeration.

Signed-off-by: default avatarEmmanuel Vadot <manu@bidouilliste.com>
parent 0dbc9b59
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ struct stor_spec {
char *name;
};
static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0, "" }, };
static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0, NULL }, };
void dev_stor_init(void)
......@@ -105,6 +105,10 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
struct blk_desc *dd;
/* Wasn't configured for this type, return 0 directly */
if (specs[type].name == NULL)
return 0;
if (first) {
di->cookie = (void *)blk_get_dev(specs[type].name, 0);
if (di->cookie == NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment