* [PATCH v2 1/2] usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY
@ 2014-07-11 12:29 Markus Pargmann
2014-07-11 12:29 ` [PATCH v2 2/2] usb: ci_hdrc_imx doc: fsl,usbphy is required Markus Pargmann
2014-07-17 11:43 ` [PATCH v2 1/2] usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY Peter Chen
0 siblings, 2 replies; 3+ messages in thread
From: Markus Pargmann @ 2014-07-11 12:29 UTC (permalink / raw)
To: linux-arm-kernel
-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>
---
drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index 2e58f8dfd311..65444b02bd68 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -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;
}
--
2.0.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] usb: ci_hdrc_imx doc: fsl,usbphy is required
2014-07-11 12:29 [PATCH v2 1/2] usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY Markus Pargmann
@ 2014-07-11 12:29 ` Markus Pargmann
2014-07-17 11:43 ` [PATCH v2 1/2] usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY Peter Chen
1 sibling, 0 replies; 3+ messages in thread
From: Markus Pargmann @ 2014-07-11 12:29 UTC (permalink / raw)
To: linux-arm-kernel
fsl,usbphy is no optional property. This patch moves it to the list of
required properties.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt
index a6a32cb7f777..1bae71e9ad47 100644
--- a/Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt
@@ -4,6 +4,7 @@ Required properties:
- compatible: Should be "fsl,imx27-usb"
- reg: Should contain registers location and length
- interrupts: Should contain controller interrupt
+- fsl,usbphy: phandle of usb phy that connects to the port
Recommended properies:
- phy_type: the type of the phy connected to the core. Should be one
@@ -12,7 +13,6 @@ Recommended properies:
- dr_mode: One of "host", "peripheral" or "otg". Defaults to "otg"
Optional properties:
-- fsl,usbphy: phandler of usb phy that connects to the only one port
- fsl,usbmisc: phandler of non-core register device, with one argument
that indicate usb controller index
- vbus-supply: regulator for vbus
--
2.0.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 1/2] usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY
2014-07-11 12:29 [PATCH v2 1/2] usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY Markus Pargmann
2014-07-11 12:29 ` [PATCH v2 2/2] usb: ci_hdrc_imx doc: fsl,usbphy is required Markus Pargmann
@ 2014-07-17 11:43 ` Peter Chen
1 sibling, 0 replies; 3+ messages in thread
From: Peter Chen @ 2014-07-17 11:43 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jul 11, 2014 at 02:29:34PM +0200, Markus Pargmann wrote:
> -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>
> ---
> drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> index 2e58f8dfd311..65444b02bd68 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -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;
> }
>
> --
> 2.0.0
>
Applied, thanks.
--
Best Regards,
Peter Chen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-17 11:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-11 12:29 [PATCH v2 1/2] usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY Markus Pargmann
2014-07-11 12:29 ` [PATCH v2 2/2] usb: ci_hdrc_imx doc: fsl,usbphy is required Markus Pargmann
2014-07-17 11:43 ` [PATCH v2 1/2] usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY Peter Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).