Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/bhnd/bhnd_subr.c
Show First 20 Lines • Show All 1,152 Lines • ▼ Show 20 Lines | bhnd_bus_generic_deactivate_resource(device_t dev, device_t child, | ||||
int type, int rid, struct bhnd_resource *r) | int type, int rid, struct bhnd_resource *r) | ||||
{ | { | ||||
if (device_get_parent(dev) != NULL) | if (device_get_parent(dev) != NULL) | ||||
return (BHND_BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), | return (BHND_BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), | ||||
child, type, rid, r)); | child, type, rid, r)); | ||||
return (EINVAL); | return (EINVAL); | ||||
}; | }; | ||||
/** | |||||
* Helper function for implementing BHND_BUS_GET_ATTACH_TYPE(). | |||||
* | |||||
* This implementation of BHND_BUS_GET_ATTACH_TYPE() simply calls the | |||||
* BHND_BUS_GET_ATTACH_TYPE() method of the parent of @p dev. | |||||
*/ | |||||
bhnd_attach_type | |||||
bhnd_bus_generic_get_attach_type(device_t dev, device_t child) | |||||
{ | |||||
/* iterate from cores via bhnd to bridge or SoC */ | |||||
if (device_get_parent(dev) != NULL) | |||||
return (BHND_BUS_GET_ATTACH_TYPE(device_get_parent(dev), | |||||
child)); | |||||
panic("bhnd_bus_get_attach_type unimplemented"); | |||||
/* Unreachable */ | |||||
return (BHND_ATTACH_ADAPTER); | |||||
} |