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
|
@ -672,7 +672,7 @@ grub_uhci_cancel_transfer (grub_usb_controller_t dev,
|
|||
}
|
||||
|
||||
static int
|
||||
grub_uhci_iterate (int (*hook) (grub_usb_controller_t dev))
|
||||
grub_uhci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data)
|
||||
{
|
||||
struct grub_uhci *u;
|
||||
struct grub_usb_controller dev;
|
||||
|
@ -680,7 +680,7 @@ grub_uhci_iterate (int (*hook) (grub_usb_controller_t dev))
|
|||
for (u = uhci; u; u = u->next)
|
||||
{
|
||||
dev.data = u;
|
||||
if (hook (&dev))
|
||||
if (hook (&dev, hook_data))
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue