aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2015-01-19 10:57:20 -0500
committerFelipe Balbi <balbi@ti.com>2015-01-19 10:57:20 -0500
commitd1fc4440d761af47fd0c32661725011bf66ebb51 (patch)
treed2fdfe049eac9b45a9418bd1be103297b1c0c55e /drivers/usb/phy
parentfe198e34a44ce7f27e39c303d62a754129938194 (diff)
parentec6f34e5b552fb0a52e6aae1a5afbbb1605cc6cc (diff)
Merge tag 'v3.19-rc5' into next
Linux 3.19-rc5 Conflicts: drivers/usb/dwc2/gadget.c drivers/usb/gadget/udc/bdc/bdc_ep.c
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r--drivers/usb/phy/phy-mv-usb.c5
-rw-r--r--drivers/usb/phy/phy.c16
2 files changed, 13 insertions, 8 deletions
diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c
index 699e38c73d82..697a741a0cb1 100644
--- a/drivers/usb/phy/phy-mv-usb.c
+++ b/drivers/usb/phy/phy-mv-usb.c
@@ -338,7 +338,6 @@ static void mv_otg_update_inputs(struct mv_otg *mvotg)
338static void mv_otg_update_state(struct mv_otg *mvotg) 338static void mv_otg_update_state(struct mv_otg *mvotg)
339{ 339{
340 struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl; 340 struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl;
341 struct usb_phy *phy = &mvotg->phy;
342 int old_state = mvotg->phy.otg->state; 341 int old_state = mvotg->phy.otg->state;
343 342
344 switch (old_state) { 343 switch (old_state) {
@@ -858,10 +857,10 @@ static int mv_otg_suspend(struct platform_device *pdev, pm_message_t state)
858{ 857{
859 struct mv_otg *mvotg = platform_get_drvdata(pdev); 858 struct mv_otg *mvotg = platform_get_drvdata(pdev);
860 859
861 if (mvotg->phy.state != OTG_STATE_B_IDLE) { 860 if (mvotg->phy.otg->state != OTG_STATE_B_IDLE) {
862 dev_info(&pdev->dev, 861 dev_info(&pdev->dev,
863 "OTG state is not B_IDLE, it is %d!\n", 862 "OTG state is not B_IDLE, it is %d!\n",
864 mvotg->phy.state); 863 mvotg->phy.otg->state);
865 return -EAGAIN; 864 return -EAGAIN;
866 } 865 }
867 866
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index b4066a001ba0..ccfdfb24b240 100644
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -34,7 +34,7 @@ static struct usb_phy *__usb_find_phy(struct list_head *list,
34 return phy; 34 return phy;
35 } 35 }
36 36
37 return ERR_PTR(-ENODEV); 37 return ERR_PTR(-EPROBE_DEFER);
38} 38}
39 39
40static struct usb_phy *__usb_find_phy_dev(struct device *dev, 40static struct usb_phy *__usb_find_phy_dev(struct device *dev,
@@ -59,6 +59,9 @@ static struct usb_phy *__of_usb_find_phy(struct device_node *node)
59{ 59{
60 struct usb_phy *phy; 60 struct usb_phy *phy;
61 61
62 if (!of_device_is_available(node))
63 return ERR_PTR(-ENODEV);
64
62 list_for_each_entry(phy, &phy_list, head) { 65 list_for_each_entry(phy, &phy_list, head) {
63 if (node != phy->dev->of_node) 66 if (node != phy->dev->of_node)
64 continue; 67 continue;
@@ -66,7 +69,7 @@ static struct usb_phy *__of_usb_find_phy(struct device_node *node)
66 return phy; 69 return phy;
67 } 70 }
68 71
69 return ERR_PTR(-ENODEV); 72 return ERR_PTR(-EPROBE_DEFER);
70} 73}
71 74
72static void devm_usb_phy_release(struct device *dev, void *res) 75static void devm_usb_phy_release(struct device *dev, void *res)
@@ -190,10 +193,13 @@ struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
190 spin_lock_irqsave(&phy_lock, flags); 193 spin_lock_irqsave(&phy_lock, flags);
191 194
192 phy = __of_usb_find_phy(node); 195 phy = __of_usb_find_phy(node);
193 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { 196 if (IS_ERR(phy)) {
194 if (!IS_ERR(phy)) 197 devres_free(ptr);
195 phy = ERR_PTR(-EPROBE_DEFER); 198 goto err1;
199 }
196 200
201 if (!try_module_get(phy->dev->driver->owner)) {
202 phy = ERR_PTR(-ENODEV);
197 devres_free(ptr); 203 devres_free(ptr);
198 goto err1; 204 goto err1;
199 } 205 }