devm_usb_get_phy_by_phandle() returns a PTR_ERR on failure, so we have
to check for IS_ERR before calling usb_phy_shutdown(), not for NULL.

Signed-off-by: Sascha Hauer <[email protected]>
Cc: Peter Chen <[email protected]>
Cc: [email protected]
---
 drivers/usb/chipidea/ci_hdrc_imx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c 
b/drivers/usb/chipidea/ci_hdrc_imx.c
index be822a2..1b7ffc9 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -165,7 +165,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
 disable_device:
        ci_hdrc_remove_device(data->ci_pdev);
 err_phy:
-       if (data->phy)
+       if (!IS_ERR(data->phy))
                usb_phy_shutdown(data->phy);
 err_clk:
        clk_disable_unprepare(data->clk);
@@ -179,7 +179,7 @@ static int ci_hdrc_imx_remove(struct platform_device *pdev)
        pm_runtime_disable(&pdev->dev);
        ci_hdrc_remove_device(data->ci_pdev);
 
-       if (data->phy)
+       if (!IS_ERR(data->phy))
                usb_phy_shutdown(data->phy);
 
        clk_disable_unprepare(data->clk);
-- 
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to