Skip to contentSkip to conversation

phy: armada375-usb2: Set drvdata for phy and use it

PATCH Superseded Axel Lin 2 participants 2 messages Feb 24, 2015 – Feb 25, 2015 Generic PHY framework

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 phy: armada375-usb2: Set drvdata for phy and use it

---
 drivers/phy/phy-armada375-usb2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/phy/phy-armada375-usb2.c +2 -1
index 7c99ca2..8ccc395 100644
@@ -37,7 +37,7 @@ static int armada375_usb_phy_init(struct phy *phy)
 	struct armada375_cluster_phy *cluster_phy;
 	u32 reg;
 
-	cluster_phy = dev_get_drvdata(phy->dev.parent);
+	cluster_phy = phy_get_drvdata(phy);
 	if (!cluster_phy)
 		return -ENODEV;
 
@@ -131,6 +131,7 @@ static int armada375_usb_phy_probe(struct platform_device *pdev)
 	cluster_phy->reg = usb_cluster_base;
 
 	dev_set_drvdata(dev, cluster_phy);
+	phy_set_drvdata(phy, cluster_phy);
 
 	phy_provider = devm_of_phy_provider_register(&pdev->dev,
 						     armada375_usb_phy_xlate);
Signature · 1 line
1.9.1
#1 lore raw
Quoted 1 line · Axel Lin

need a commit msg pls.

-Kishon

Quoted 26 lines
---
  drivers/phy/phy-armada375-usb2.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/phy/phy-armada375-usb2.c +2 -1
index 7c99ca2..8ccc395 100644
@@ -37,7 +37,7 @@ static int armada375_usb_phy_init(struct phy *phy)
  	struct armada375_cluster_phy *cluster_phy;
  	u32 reg;
 
-	cluster_phy = dev_get_drvdata(phy->dev.parent);
+	cluster_phy = phy_get_drvdata(phy);
  	if (!cluster_phy)
  		return -ENODEV;
 
@@ -131,6 +131,7 @@ static int armada375_usb_phy_probe(struct platform_device *pdev)
  	cluster_phy->reg = usb_cluster_base;
 
  	dev_set_drvdata(dev, cluster_phy);
+	phy_set_drvdata(phy, cluster_phy);
 
  	phy_provider = devm_of_phy_provider_register(&pdev->dev,
  						     armada375_usb_phy_xlate);