Skip to contentSkip to conversation

usb: phy: phy-mxs-usb: set the correct platform drvdata

PATCH In review Jisheng Zhang 2 participants 2 messages Nov 7, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: phy: phy-mxs-usb: set the correct platform drvdata

We need to set mxs_phy rather as the platform drvdata so that we can get the correct mxs_phy in mxs_phy_remove().

---
 drivers/usb/phy/phy-mxs-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy-mxs-usb.c +1 -1
index fdd33b4..545844b 100644
@@ -164,7 +164,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
 
 	mxs_phy->clk = clk;
 
-	platform_set_drvdata(pdev, &mxs_phy->phy);
+	platform_set_drvdata(pdev, mxs_phy);
 
 	ret = usb_add_phy_dev(&mxs_phy->phy);
 	if (ret)
Signature · 1 line
1.8.4.2
Acked-by on v2 1/1
#1 lore raw
Quoted 13 lines
---
 drivers/usb/phy/phy-mxs-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy-mxs- renamed from drivers/usb/phy/phy-mxs-usb.c +0 -0

usb.c
index fdd33b4..545844b 100644

drivers/usb/phy/phy-mxs-usb.c static int mxs_phy_probe(struct platform_device *pdev)

Quoted 9 lines
drivers/usb/phy/phy-mxs-usb.c +1 -2
@@ -164,7 +164,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
 
 	mxs_phy->clk = clk;
 
-	platform_set_drvdata(pdev, &mxs_phy->phy);
+	platform_set_drvdata(pdev, mxs_phy);
 
 	ret = usb_add_phy_dev(&mxs_phy->phy);
 	if (ret)
--

It is so unlucky the struct usb_phy phy is the first element of struct mxs_phy, so we haven't run any problems.

Jisheng, thanks for fixing it.