Skip to content
Snippets Groups Projects
Commit ce2a07b7 authored by Andreas Färber's avatar Andreas Färber Committed by Tom Rini
Browse files

api_storage: Fix non-first storage device enumeration


When enabling CONFIG_API and chain-loading GRUB2 on jetson-tk1, only the
eMMC would show up as (hd0), but not the SD card, leading to GRUB not
finding its configuration and modules, falling back to a rescue shell.

This is because enum_ended would get set for !more after returning a
cookie for the first MMC device in group 3.

Fix this by properly setting the "more" argument also in the case of the
first storage device of a group.

Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
parent 86dc8b14
No related branches found
No related tags found
No related merge requests found
...@@ -112,6 +112,11 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) ...@@ -112,6 +112,11 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
else else
found = 1; found = 1;
/* provide hint if there are more devices in
* this group to enumerate */
if (1 < specs[type].max_dev)
*more = 1;
} else { } else {
for (i = 0; i < specs[type].max_dev; i++) for (i = 0; i < specs[type].max_dev; i++)
if (di->cookie == (void *)get_dev(specs[type].name, i)) { if (di->cookie == (void *)get_dev(specs[type].name, i)) {
......
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