diff options
author | Felipe Balbi <balbi@ti.com> | 2013-03-15 05:03:30 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-03-18 05:18:31 -0400 |
commit | 6f3ed4ec182d191d1ba48fbf5aed021d2d00dd37 (patch) | |
tree | 6d03fa705dc60cce08342d9029defd9540f5044d | |
parent | e299bd93e4fb8e3fa426d30e0a0796b99052a572 (diff) |
usb: host: ehci-mv: fix PHY error handling
PHY layer no longer returns NULL. We must
switch from IS_ERR_OR_NULL() to IS_ERR().
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/host/ehci-mv.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index 9751823395e1..38048200977c 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c | |||
@@ -240,12 +240,16 @@ static int mv_ehci_probe(struct platform_device *pdev) | |||
240 | 240 | ||
241 | ehci_mv->mode = pdata->mode; | 241 | ehci_mv->mode = pdata->mode; |
242 | if (ehci_mv->mode == MV_USB_MODE_OTG) { | 242 | if (ehci_mv->mode == MV_USB_MODE_OTG) { |
243 | #if IS_ENABLED(CONFIG_USB_PHY) | ||
244 | ehci_mv->otg = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2); | 243 | ehci_mv->otg = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2); |
245 | if (IS_ERR_OR_NULL(ehci_mv->otg)) { | 244 | if (IS_ERR(ehci_mv->otg)) { |
246 | dev_err(&pdev->dev, | 245 | retval = PTR_ERR(ehci_mv->otg); |
247 | "unable to find transceiver\n"); | 246 | |
248 | retval = -ENODEV; | 247 | if (retval == -ENXIO) |
248 | dev_info(&pdev->dev, "MV_USB_MODE_OTG " | ||
249 | "must have CONFIG_USB_PHY enabled\n"); | ||
250 | else | ||
251 | dev_err(&pdev->dev, | ||
252 | "unable to find transceiver\n"); | ||
249 | goto err_disable_clk; | 253 | goto err_disable_clk; |
250 | } | 254 | } |
251 | 255 | ||
@@ -258,11 +262,6 @@ static int mv_ehci_probe(struct platform_device *pdev) | |||
258 | } | 262 | } |
259 | /* otg will enable clock before use as host */ | 263 | /* otg will enable clock before use as host */ |
260 | mv_ehci_disable(ehci_mv); | 264 | mv_ehci_disable(ehci_mv); |
261 | #else | ||
262 | dev_info(&pdev->dev, "MV_USB_MODE_OTG " | ||
263 | "must have CONFIG_USB_PHY enabled\n"); | ||
264 | goto err_disable_clk; | ||
265 | #endif | ||
266 | } else { | 265 | } else { |
267 | if (pdata->set_vbus) | 266 | if (pdata->set_vbus) |
268 | pdata->set_vbus(1); | 267 | pdata->set_vbus(1); |