aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/phy/phy-omap-usb2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/phy/phy-omap-usb2.c')
-rw-r--r--drivers/phy/phy-omap-usb2.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c
index f091576b6449..4e489a8850e5 100644
--- a/drivers/phy/phy-omap-usb2.c
+++ b/drivers/phy/phy-omap-usb2.c
@@ -60,7 +60,7 @@ EXPORT_SYMBOL_GPL(omap_usb2_set_comparator);
60 60
61static int omap_usb_set_vbus(struct usb_otg *otg, bool enabled) 61static int omap_usb_set_vbus(struct usb_otg *otg, bool enabled)
62{ 62{
63 struct omap_usb *phy = phy_to_omapusb(otg->phy); 63 struct omap_usb *phy = phy_to_omapusb(otg->usb_phy);
64 64
65 if (!phy->comparator) 65 if (!phy->comparator)
66 return -ENODEV; 66 return -ENODEV;
@@ -70,7 +70,7 @@ static int omap_usb_set_vbus(struct usb_otg *otg, bool enabled)
70 70
71static int omap_usb_start_srp(struct usb_otg *otg) 71static int omap_usb_start_srp(struct usb_otg *otg)
72{ 72{
73 struct omap_usb *phy = phy_to_omapusb(otg->phy); 73 struct omap_usb *phy = phy_to_omapusb(otg->usb_phy);
74 74
75 if (!phy->comparator) 75 if (!phy->comparator)
76 return -ENODEV; 76 return -ENODEV;
@@ -80,11 +80,9 @@ static int omap_usb_start_srp(struct usb_otg *otg)
80 80
81static int omap_usb_set_host(struct usb_otg *otg, struct usb_bus *host) 81static int omap_usb_set_host(struct usb_otg *otg, struct usb_bus *host)
82{ 82{
83 struct usb_phy *phy = otg->phy;
84
85 otg->host = host; 83 otg->host = host;
86 if (!host) 84 if (!host)
87 phy->state = OTG_STATE_UNDEFINED; 85 otg->state = OTG_STATE_UNDEFINED;
88 86
89 return 0; 87 return 0;
90} 88}
@@ -92,11 +90,9 @@ static int omap_usb_set_host(struct usb_otg *otg, struct usb_bus *host)
92static int omap_usb_set_peripheral(struct usb_otg *otg, 90static int omap_usb_set_peripheral(struct usb_otg *otg,
93 struct usb_gadget *gadget) 91 struct usb_gadget *gadget)
94{ 92{
95 struct usb_phy *phy = otg->phy;
96
97 otg->gadget = gadget; 93 otg->gadget = gadget;
98 if (!gadget) 94 if (!gadget)
99 phy->state = OTG_STATE_UNDEFINED; 95 otg->state = OTG_STATE_UNDEFINED;
100 96
101 return 0; 97 return 0;
102} 98}
@@ -255,12 +251,12 @@ static int omap_usb2_probe(struct platform_device *pdev)
255 otg->set_vbus = omap_usb_set_vbus; 251 otg->set_vbus = omap_usb_set_vbus;
256 if (phy_data->flags & OMAP_USB2_HAS_START_SRP) 252 if (phy_data->flags & OMAP_USB2_HAS_START_SRP)
257 otg->start_srp = omap_usb_start_srp; 253 otg->start_srp = omap_usb_start_srp;
258 otg->phy = &phy->phy; 254 otg->usb_phy = &phy->phy;
259 255
260 platform_set_drvdata(pdev, phy); 256 platform_set_drvdata(pdev, phy);
261 pm_runtime_enable(phy->dev); 257 pm_runtime_enable(phy->dev);
262 258
263 generic_phy = devm_phy_create(phy->dev, NULL, &ops, NULL); 259 generic_phy = devm_phy_create(phy->dev, NULL, &ops);
264 if (IS_ERR(generic_phy)) { 260 if (IS_ERR(generic_phy)) {
265 pm_runtime_disable(phy->dev); 261 pm_runtime_disable(phy->dev);
266 return PTR_ERR(generic_phy); 262 return PTR_ERR(generic_phy);