pci_mfree(d->aux);
}
-static void
+static int
device_port_lookup(struct pci_dev *d)
{
mach_port_t device_port;
device_port = file_name_lookup(server, 0, 0);
*((mach_port_t *) d->aux) = device_port;
+
+ return d->aux != MACH_PORT_NULL;
}
/* Walk through the FS tree to see what is allowed for us */
d->func = func;
/* Get the arbiter port */
- device_port_lookup(d);
- if (d->aux == MACH_PORT_NULL)
+ if (!device_port_lookup(d))
{
if (closedir(dir) < 0)
a->warning("Cannot close directory: %s (%s)", parent,
if (*((mach_port_t *) d->aux) == MACH_PORT_NULL)
{
/* We still don't have the port for this device */
- device_port_lookup(d);
- if (d->aux == MACH_PORT_NULL)
+ if (device_port_lookup(d))
{
d->access->error("Cannot find the PCI arbiter");
}
if (*((mach_port_t *) d->aux) == MACH_PORT_NULL)
{
/* We still don't have the port for this device */
- device_port_lookup(d);
- if (d->aux == MACH_PORT_NULL)
+ if (device_port_lookup(d))
{
d->access->error("Cannot find the PCI arbiter");
}