summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2015-09-17 17:00:08 -0400
committerTom Rini <[email protected]>2015-09-17 17:00:08 -0400
commit1fb8d7933924aa5deb7e722d64c1d9fc7f0b2b82 (patch)
tree3078931eaf7785303e12478e0cfd27ce4731dcf7 /include/dm
parent5779b862d148294cc496ae2d6652584601ffd16e (diff)
parentc6d4705f41d4e45e8cecc6e08b0b89df1ffe57ef (diff)
Merge git://git.denx.de/u-boot-x86
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/device.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index a239be64691..85196124b4d 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -485,6 +485,17 @@ bool device_is_last_sibling(struct udevice *dev);
*/
int device_set_name(struct udevice *dev, const char *name);
+/**
+ * device_is_on_pci_bus - Test if a device is on a PCI bus
+ *
+ * @dev: device to test
+ * @return: true if it is on a PCI bus, false otherwise
+ */
+static inline bool device_is_on_pci_bus(struct udevice *dev)
+{
+ return device_get_uclass_id(dev->parent) == UCLASS_PCI;
+}
+
/* device resource management */
typedef void (*dr_release_t)(struct udevice *dev, void *res);
typedef int (*dr_match_t)(struct udevice *dev, void *res, void *match_data);