* disk/ieee1275/nand.c (grub_nand_iterate): Return
grub_devalias_iterate() result instead of unconditional 0. * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Likewise. Also, capture hook return value, either directly or via grub_children_iterate(), and propagate to caller. * include/grub/ieee1275/ieee1275.h (grub_devalias_iterate, grub_children_iterate): Return value is now 'int' instead of 'grub_err_t'. * kern/ieee1275/openfw.c (grub_children_iterate): Fix to behave like a proper iterator, stopping when hooks return non-zero. (grub_devalias_iterate): Likewise.
This commit is contained in:
parent
ac20caff54
commit
0dcf7495d9
5 changed files with 44 additions and 26 deletions
|
@ -77,6 +77,8 @@ grub_ofdisk_iterate (int (*hook) (const char *name))
|
|||
|
||||
int dev_iterate (struct grub_ieee1275_devalias *alias)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
grub_dprintf ("disk", "disk name = %s\n", alias->name);
|
||||
|
||||
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY))
|
||||
|
@ -105,17 +107,16 @@ grub_ofdisk_iterate (int (*hook) (const char *name))
|
|||
}
|
||||
|
||||
if (! grub_strcmp (alias->type, "block"))
|
||||
hook (alias->name);
|
||||
ret = hook (alias->name);
|
||||
else if ((! grub_strcmp (alias->type, "scsi"))
|
||||
|| (! grub_strcmp (alias->type, "ide"))
|
||||
|| (! grub_strcmp (alias->type, "ata")))
|
||||
/* Search for block-type children of these bus controllers. */
|
||||
grub_children_iterate (alias->name, dev_iterate);
|
||||
return 0;
|
||||
ret = grub_children_iterate (alias->name, dev_iterate);
|
||||
return ret;
|
||||
}
|
||||
|
||||
grub_devalias_iterate (dev_iterate);
|
||||
return 0;
|
||||
return grub_devalias_iterate (dev_iterate);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue