Add wrappers around the newly created bus_child_pnpinfo_str and

bus_child_location_str.
This commit is contained in:
Warner Losh 2002-10-07 07:08:00 +00:00
parent 689ab99fb3
commit 0a1d3ef9b8
2 changed files with 31 additions and 3 deletions

View File

@ -1785,9 +1785,35 @@ bus_delete_resource(device_t dev, int type, int rid)
}
int
bus_child_present(device_t dev)
bus_child_present(device_t child)
{
return (BUS_CHILD_PRESENT(device_get_parent(dev), dev));
return (BUS_CHILD_PRESENT(device_get_parent(child), child));
}
int
bus_child_pnpinfo_str(device_t child, char *buf, size_t buflen)
{
device_t parent;
parent = device_get_parent(child);
if (parent == NULL) {
*buf = '\0';
return (0);
}
return (BUS_CHILD_PNPINFO_STR(parent, child, buf, buflen));
}
int
bus_child_location_str(device_t child, char *buf, size_t buflen)
{
device_t parent;
parent = device_get_parent(child);
if (parent == NULL) {
*buf = '\0';
return (0);
}
return (BUS_CHILD_LOCATION_STR(parent, child, buf, buflen));
}
static int

View File

@ -279,7 +279,9 @@ int bus_get_resource(device_t dev, int type, int rid,
u_long bus_get_resource_start(device_t dev, int type, int rid);
u_long bus_get_resource_count(device_t dev, int type, int rid);
void bus_delete_resource(device_t dev, int type, int rid);
int bus_child_present(device_t dev);
int bus_child_present(device_t child);
int bus_child_pnpinfo_str(device_t child, char *buf, size_t buflen);
int bus_child_location_str(device_t child, char *buf, size_t buflen);
/*
* Access functions for device.