aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bhnd/bhnd.h
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2016-05-08 17:52:12 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2016-05-08 17:52:12 +0000
commitd935257080c4a38ed06d297dfc376c1a7b727d29 (patch)
tree18dfbee44ad83a2e63df0aebdd176c146461e8bb /sys/dev/bhnd/bhnd.h
parent7206c4fc60c1fbf561c1eb04129201bf3a617b72 (diff)
downloadsrc-d935257080c4a38ed06d297dfc376c1a7b727d29.tar.gz
src-d935257080c4a38ed06d297dfc376c1a7b727d29.zip
[bhnd] Replace is_hostb_device() with a more general find_hostb_device()
This allows bus children to query for the host bridge device, rather than having to iterate over all attached devices. Submitted by: Landon Fuller <landonf@landonf.org> Differential Revision: https://reviews.freebsd.org/D6193
Notes
Notes: svn path=/head/; revision=299235
Diffstat (limited to 'sys/dev/bhnd/bhnd.h')
-rw-r--r--sys/dev/bhnd/bhnd.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/bhnd/bhnd.h b/sys/dev/bhnd/bhnd.h
index 758955695650..1b0cecff47fd 100644
--- a/sys/dev/bhnd/bhnd.h
+++ b/sys/dev/bhnd/bhnd.h
@@ -335,8 +335,6 @@ void bhnd_set_custom_core_desc(device_t dev,
void bhnd_set_default_core_desc(device_t dev);
-bool bhnd_bus_generic_is_hostb_device(device_t dev,
- device_t child);
bool bhnd_bus_generic_is_hw_disabled(device_t dev,
device_t child);
bool bhnd_bus_generic_is_region_valid(device_t dev,
@@ -364,14 +362,14 @@ int bhnd_bus_generic_deactivate_resource (device_t dev,
/**
- * Return true if @p dev is serving as a host bridge for its parent bhnd
- * bus.
+ * Return the active host bridge core for the bhnd bus, if any, or NULL if
+ * not found.
*
- * @param dev A bhnd bus child device.
+ * @param dev A bhnd bus device.
*/
-static inline bool
-bhnd_is_hostb_device(device_t dev) {
- return (BHND_BUS_IS_HOSTB_DEVICE(device_get_parent(dev), dev));
+static inline device_t
+bhnd_find_hostb_device(device_t dev) {
+ return (BHND_BUS_FIND_HOSTB_DEVICE(dev));
}
/**