Alter the return value and arguments of the GET_RESOURCE_LIST bus method.
Alter consumers of this method to conform to the new convention. Minor cosmetic adjustments to bus.h. This isn't of concern as this interface isn't in use yet.
This commit is contained in:
parent
e19bc84f20
commit
46aa504e42
@ -240,8 +240,7 @@ METHOD void delete_resource {
|
||||
#
|
||||
# Return a struct resource_list.
|
||||
#
|
||||
METHOD int get_resource_list {
|
||||
METHOD struct resource_list * get_resource_list {
|
||||
device_t dev;
|
||||
device_t child;
|
||||
struct resource_list *rl;
|
||||
} DEFAULT bus_generic_get_resource_list;
|
||||
|
@ -1850,11 +1850,10 @@ bus_generic_write_ivar(device_t dev, device_t child, int index,
|
||||
return ENOENT;
|
||||
}
|
||||
|
||||
int
|
||||
bus_generic_get_resource_list (device_t dev, device_t child,
|
||||
struct resource_list *rl)
|
||||
struct resource_list *
|
||||
bus_generic_get_resource_list (device_t dev, device_t child)
|
||||
{
|
||||
return ENOENT;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
@ -1947,11 +1946,10 @@ bus_generic_rl_get_resource (device_t dev, device_t child, int type, int rid,
|
||||
{
|
||||
struct resource_list * rl = NULL;
|
||||
struct resource_list_entry * rle = NULL;
|
||||
int retval = 0;
|
||||
|
||||
retval = BUS_GET_RESOURCE_LIST(dev, child, rl);
|
||||
if (retval)
|
||||
return (retval);
|
||||
rl = BUS_GET_RESOURCE_LIST(dev, child);
|
||||
if (!rl)
|
||||
return (EINVAL);
|
||||
|
||||
rle = resource_list_find(rl, type, rid);
|
||||
if (!rle)
|
||||
@ -1970,11 +1968,10 @@ bus_generic_rl_set_resource (device_t dev, device_t child, int type, int rid,
|
||||
u_long start, u_long count)
|
||||
{
|
||||
struct resource_list * rl = NULL;
|
||||
int retval = 0;
|
||||
|
||||
retval = BUS_GET_RESOURCE_LIST(dev, child, rl);
|
||||
if (retval)
|
||||
return (retval);
|
||||
rl = BUS_GET_RESOURCE_LIST(dev, child);
|
||||
if (!rl)
|
||||
return (EINVAL);
|
||||
|
||||
resource_list_add(rl, type, rid, start, (start + count - 1), count);
|
||||
|
||||
@ -1985,10 +1982,9 @@ void
|
||||
bus_generic_rl_delete_resource (device_t dev, device_t child, int type, int rid)
|
||||
{
|
||||
struct resource_list * rl = NULL;
|
||||
int retval = 0;
|
||||
|
||||
retval = BUS_GET_RESOURCE_LIST(dev, child, rl);
|
||||
if (retval)
|
||||
rl = BUS_GET_RESOURCE_LIST(dev, child);
|
||||
if (!rl)
|
||||
return;
|
||||
|
||||
resource_list_delete(rl, type, rid);
|
||||
@ -2001,11 +1997,10 @@ bus_generic_rl_release_resource (device_t dev, device_t child, int type,
|
||||
int rid, struct resource *r)
|
||||
{
|
||||
struct resource_list * rl = NULL;
|
||||
int retval = 0;
|
||||
|
||||
retval = BUS_GET_RESOURCE_LIST(dev, child, rl);
|
||||
if (retval)
|
||||
return (retval);
|
||||
rl = BUS_GET_RESOURCE_LIST(dev, child);
|
||||
if (!rl)
|
||||
return (EINVAL);
|
||||
|
||||
return (resource_list_release(rl, dev, child, type, rid, r));
|
||||
}
|
||||
@ -2016,11 +2011,10 @@ bus_generic_rl_alloc_resource (device_t dev, device_t child, int type,
|
||||
u_long count, u_int flags)
|
||||
{
|
||||
struct resource_list * rl = NULL;
|
||||
int retval = 0;
|
||||
|
||||
retval = BUS_GET_RESOURCE_LIST(dev, child, rl);
|
||||
if (retval)
|
||||
return (0);
|
||||
rl = BUS_GET_RESOURCE_LIST(dev, child);
|
||||
if (!rl)
|
||||
return (NULL);
|
||||
|
||||
return resource_list_alloc(rl, dev, child, type, rid,
|
||||
start, end, count, flags);
|
||||
|
@ -192,16 +192,18 @@ void root_bus_configure(void);
|
||||
|
||||
int bus_generic_activate_resource(device_t dev, device_t child, int type,
|
||||
int rid, struct resource *r);
|
||||
struct resource *bus_generic_alloc_resource(device_t bus, device_t child,
|
||||
int type, int *rid,
|
||||
u_long start, u_long end,
|
||||
u_long count, u_int flags);
|
||||
struct resource *
|
||||
bus_generic_alloc_resource(device_t bus, device_t child,
|
||||
int type, int *rid,
|
||||
u_long start, u_long end,
|
||||
u_long count, u_int flags);
|
||||
int bus_generic_attach(device_t dev);
|
||||
int bus_generic_deactivate_resource(device_t dev, device_t child, int type,
|
||||
int rid, struct resource *r);
|
||||
int bus_generic_detach(device_t dev);
|
||||
void bus_generic_driver_added(device_t dev, driver_t *driver);
|
||||
int bus_generic_get_resource_list (device_t, device_t, struct resource_list *);
|
||||
struct resource_list *
|
||||
bus_generic_get_resource_list (device_t, device_t);
|
||||
int bus_print_child_header(device_t dev, device_t child);
|
||||
int bus_print_child_footer(device_t dev, device_t child);
|
||||
int bus_generic_print_child(device_t dev, device_t child);
|
||||
@ -215,12 +217,16 @@ int bus_generic_setup_intr(device_t dev, device_t child,
|
||||
struct resource *irq, int flags,
|
||||
driver_intr_t *intr, void *arg, void **cookiep);
|
||||
|
||||
struct resource *bus_generic_rl_alloc_resource (device_t, device_t, int, int *,
|
||||
u_long, u_long, u_long, u_int);
|
||||
struct resource *
|
||||
bus_generic_rl_alloc_resource (device_t, device_t, int, int *,
|
||||
u_long, u_long, u_long, u_int);
|
||||
void bus_generic_rl_delete_resource (device_t, device_t, int, int);
|
||||
int bus_generic_rl_get_resource (device_t, device_t, int, int, u_long *, u_long *);
|
||||
int bus_generic_rl_set_resource (device_t, device_t, int, int, u_long, u_long);
|
||||
int bus_generic_rl_release_resource(device_t, device_t, int, int, struct resource *);
|
||||
int bus_generic_rl_get_resource (device_t, device_t, int, int, u_long *,
|
||||
u_long *);
|
||||
int bus_generic_rl_set_resource (device_t, device_t, int, int, u_long,
|
||||
u_long);
|
||||
int bus_generic_rl_release_resource (device_t, device_t, int, int,
|
||||
struct resource *);
|
||||
|
||||
int bus_generic_shutdown(device_t dev);
|
||||
int bus_generic_suspend(device_t dev);
|
||||
|
Loading…
Reference in New Issue
Block a user