The present logic doesn't fetch the correct parent node when two usb nodes
are enabled. It searches all nodes and doesn't fetch the first node with
matching compatible string when two usb nodes are enabled.
This patch fixes the logic by searching "xlnx,zynqmp-dwc3" compatible
string only in the parent nodes instead of the searching all nodes.
Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
void dwc3_simple_wakeup_capable(struct device *dev, bool wakeup)
{
- struct device_node *node =
- of_find_compatible_node(dev->of_node, NULL, "xlnx,zynqmp-dwc3");
+ struct device_node *node = of_node_get(dev->parent->of_node);
+
+ /* check for valid parent node */
+ while (node) {
+ if (!of_device_is_compatible(node, "xlnx,zynqmp-dwc3"))
+ node = of_get_next_parent(node);
+ else
+ break;
+ }
if (node) {
struct platform_device *pdev_parent;