summaryrefslogtreecommitdiffstats
path: root/include/dm
diff options
context:
space:
mode:
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 a239be6469..85196124b4 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);
OpenPOWER on IntegriCloud