Remove nested functions from USB iterators.
* include/grub/usb.h (grub_usb_iterate_hook_t): New type. (grub_usb_controller_iterate_hook_t): Likewise. (grub_usb_iterate): Add hook_data argument. (grub_usb_controller_iterate): Likewise. (struct grub_usb_controller_dev.iterate): Likewise. Update all implementations and callers.
This commit is contained in:
parent
18288f17ac
commit
5fdbaed168
9 changed files with 108 additions and 75 deletions
|
@ -483,7 +483,7 @@ grub_ohci_inithw (void)
|
|||
|
||||
|
||||
static int
|
||||
grub_ohci_iterate (int (*hook) (grub_usb_controller_t dev))
|
||||
grub_ohci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data)
|
||||
{
|
||||
struct grub_ohci *o;
|
||||
struct grub_usb_controller dev;
|
||||
|
@ -491,7 +491,7 @@ grub_ohci_iterate (int (*hook) (grub_usb_controller_t dev))
|
|||
for (o = ohci; o; o = o->next)
|
||||
{
|
||||
dev.data = o;
|
||||
if (hook (&dev))
|
||||
if (hook (&dev, hook_data))
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue