#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/of.h>
+#include <linux/of_graph.h>
#include <linux/of_platform.h>
#include <linux/pci.h>
#include <linux/pci-pwrctrl.h>
/*
* Check whether the pwrctrl device really needs to be created or not.
- * This is decided based on at least one of the power supplies being
- * defined in the devicetree node of the device.
+ * This is decided based on at least one of the power supplies defined
+ * in the devicetree node of the device or the graph property.
*/
- if (!of_pci_supply_present(np)) {
+ if (!of_pci_supply_present(np) && !of_graph_is_present(np)) {
dev_dbg(parent, "Skipping OF node: %s\n", np->name);
return 0;
}