Skip to content

Commit 1d7cb11

Browse files
committed
phy: core: Fix phy_get() to not return error on link creation failure
commit 987351e ("phy: core: Add consumer device link support") added device link support between PHY consumer and PHY provider. However certain peripherals (DWC3 ULPI) have cyclic dependency between the PHY provider and PHY consumer causing the device link creation to fail. Instead of erroring out on failure to create device link, only add a debug print to indicate device link creation failed to get USB working again in multiple platforms. Fixes: 987351e ("phy: core: Add consumer device link support") Cc: Alexandre Torgue <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]> Reviewed-by: Alexandre TORGUE <[email protected]>
1 parent 46b7edf commit 1d7cb11

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

drivers/phy/phy-core.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -688,11 +688,9 @@ struct phy *phy_get(struct device *dev, const char *string)
688688
get_device(&phy->dev);
689689

690690
link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
691-
if (!link) {
692-
dev_err(dev, "failed to create device link to %s\n",
691+
if (!link)
692+
dev_dbg(dev, "failed to create device link to %s\n",
693693
dev_name(phy->dev.parent));
694-
return ERR_PTR(-EINVAL);
695-
}
696694

697695
return phy;
698696
}
@@ -803,11 +801,9 @@ struct phy *devm_of_phy_get(struct device *dev, struct device_node *np,
803801
}
804802

805803
link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
806-
if (!link) {
807-
dev_err(dev, "failed to create device link to %s\n",
804+
if (!link)
805+
dev_dbg(dev, "failed to create device link to %s\n",
808806
dev_name(phy->dev.parent));
809-
return ERR_PTR(-EINVAL);
810-
}
811807

812808
return phy;
813809
}
@@ -852,11 +848,9 @@ struct phy *devm_of_phy_get_by_index(struct device *dev, struct device_node *np,
852848
devres_add(dev, ptr);
853849

854850
link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
855-
if (!link) {
856-
dev_err(dev, "failed to create device link to %s\n",
851+
if (!link)
852+
dev_dbg(dev, "failed to create device link to %s\n",
857853
dev_name(phy->dev.parent));
858-
return ERR_PTR(-EINVAL);
859-
}
860854

861855
return phy;
862856
}

0 commit comments

Comments
 (0)