lkml.org 
[lkml]   [2015]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 03/20] phy: armada375-usb2: Set drvdata for phy and use it
Date
From: Axel Lin <axel.lin@ingics.com>

At the context we have pointer to struct phy, it's useful to call
phy_get_drvdata() to get the address of cluster_phy. This has slightly
better readability than calling dev_get_drvdata(phy->dev.parent).

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/phy/phy-armada375-usb2.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/phy-armada375-usb2.c b/drivers/phy/phy-armada375-usb2.c
index 7c99ca2..8ccc395 100644
--- a/drivers/phy/phy-armada375-usb2.c
+++ b/drivers/phy/phy-armada375-usb2.c
@@ -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);
--
1.7.9.5


\
 
 \ /
  Last update: 2015-03-13 13:41    [W:0.062 / U:5.308 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site