usb: host: ehci-tegra: fix PHY error handling
PHY layer no longer returns NULL, we must switch from IS_ERR_OR_NULL() to IS_ERR(). Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
249751f223
commit
4261b8f353
1 changed files with 3 additions and 9 deletions
|
@ -768,14 +768,12 @@ static int tegra_ehci_probe(struct platform_device *pdev)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_USB_PHY)
|
|
||||||
if (pdata->operating_mode == TEGRA_USB_OTG) {
|
if (pdata->operating_mode == TEGRA_USB_OTG) {
|
||||||
tegra->transceiver =
|
tegra->transceiver =
|
||||||
devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
|
devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
|
||||||
if (!IS_ERR_OR_NULL(tegra->transceiver))
|
if (!IS_ERR(tegra->transceiver))
|
||||||
otg_set_host(tegra->transceiver->otg, &hcd->self);
|
otg_set_host(tegra->transceiver->otg, &hcd->self);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
err = usb_add_hcd(hcd, irq, IRQF_SHARED);
|
err = usb_add_hcd(hcd, irq, IRQF_SHARED);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -794,10 +792,8 @@ static int tegra_ehci_probe(struct platform_device *pdev)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
#if IS_ENABLED(CONFIG_USB_PHY)
|
if (!IS_ERR(tegra->transceiver))
|
||||||
if (!IS_ERR_OR_NULL(tegra->transceiver))
|
|
||||||
otg_set_host(tegra->transceiver->otg, NULL);
|
otg_set_host(tegra->transceiver->otg, NULL);
|
||||||
#endif
|
|
||||||
usb_phy_shutdown(hcd->phy);
|
usb_phy_shutdown(hcd->phy);
|
||||||
fail_io:
|
fail_io:
|
||||||
clk_disable_unprepare(tegra->clk);
|
clk_disable_unprepare(tegra->clk);
|
||||||
|
@ -815,10 +811,8 @@ static int tegra_ehci_remove(struct platform_device *pdev)
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
pm_runtime_put_noidle(&pdev->dev);
|
pm_runtime_put_noidle(&pdev->dev);
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_USB_PHY)
|
if (!IS_ERR(tegra->transceiver))
|
||||||
if (!IS_ERR_OR_NULL(tegra->transceiver))
|
|
||||||
otg_set_host(tegra->transceiver->otg, NULL);
|
otg_set_host(tegra->transceiver->otg, NULL);
|
||||||
#endif
|
|
||||||
|
|
||||||
usb_phy_shutdown(hcd->phy);
|
usb_phy_shutdown(hcd->phy);
|
||||||
usb_remove_hcd(hcd);
|
usb_remove_hcd(hcd);
|
||||||
|
|
Loading…
Add table
Reference in a new issue