From: Axel Lin Date: Wed, 25 Feb 2015 23:24:49 +0000 (+0800) Subject: phy: armada375-usb2: Set drvdata for phy and use it X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7a83b145b5891f445009b341361e2e458bd13d2b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git phy: armada375-usb2: Set drvdata for phy and use it 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 Signed-off-by: Kishon Vijay Abraham I --- diff --git a/drivers/phy/phy-armada375-usb2.c b/drivers/phy/phy-armada375-usb2.c index 7c99ca256f05..8ccc3952c13d 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);