]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY
authorMarkus Pargmann <mpa@pengutronix.de>
Tue, 22 Jul 2014 02:09:43 +0000 (10:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jul 2014 23:31:36 +0000 (16:31 -0700)
-ENODEV is interpreted by the generic driver probing function as a
non-matching driver. This leads to a missing probe failure message.

Also a missing USB PHY is more of an invalid configuration of the usb
driver because it is necessary.

This patch returns -EINVAL if devm_usb_get_phy_by_phandle() returned -ENODEV.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/ci_hdrc_imx.c

index 2e58f8dfd3112eb40dc398c883552a69b867d567..65444b02bd683a33e53e8c6b9f5c628a05544bed 100644 (file)
@@ -133,6 +133,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
        data->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0);
        if (IS_ERR(data->phy)) {
                ret = PTR_ERR(data->phy);
+               /* Return -EINVAL if no usbphy is available */
+               if (ret == -ENODEV)
+                       ret = -EINVAL;
                goto err_clk;
        }