Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <axel.lin@ingics.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Axel Lin and committed by
Kishon Vijay Abraham I
7a83b145 5bd568f5

+2 -1
+2 -1
drivers/phy/phy-armada375-usb2.c
··· 37 37 struct armada375_cluster_phy *cluster_phy; 38 38 u32 reg; 39 39 40 - cluster_phy = dev_get_drvdata(phy->dev.parent); 40 + cluster_phy = phy_get_drvdata(phy); 41 41 if (!cluster_phy) 42 42 return -ENODEV; 43 43 ··· 131 131 cluster_phy->reg = usb_cluster_base; 132 132 133 133 dev_set_drvdata(dev, cluster_phy); 134 + phy_set_drvdata(phy, cluster_phy); 134 135 135 136 phy_provider = devm_of_phy_provider_register(&pdev->dev, 136 137 armada375_usb_phy_xlate);