Skip to contentSkip to conversation

usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY

PATCH Superseded Markus Pargmann 2 participants 4 messages Jul 8, 2014 – Jul 9, 2014

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 usb: ci_hdrc_imx: Return -EINVAL for missing USB PHY

-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.

---
 drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/chipidea/ci_hdrc_imx.c +3 -0
index 2e58f8dfd311..65444b02bd68 100644
@@ -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;
 	}
 
Signature · 1 line
2.0.0
#1 lore raw

PATCH 2/2 usb: ci_hdrc_imx doc: fsl,usbphy is required

fsl,usbphy is no optional property. This patch moves it to the list of required properties.

---
 Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt +1 -1
index a6a32cb7f777..8014d0d050f8 100644
@@ -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: phandler of usb phy that connects to the only one 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
Signature · 1 line
2.0.0
#2 lore raw

PATCH 2/2 usb: ci_hdrc_imx doc: fsl,usbphy is required

Hello.

Quoted 13 lines · Markus Pargmann

fsl,usbphy is no optional property. This patch moves it to the list of required properties.

---
  Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt +0 -0
index a6a32cb7f777..8014d0d050f8 100644

Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt Required properties: · line 7

Quoted 4 lines
Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt +1 -0
@@ -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: phandler of usb phy that connects to the only one port

s/phandler/phandle/. Can fix, while at it...

Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt Recommended properies: · line 18

Quoted 8 lines
Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt +0 -1
@@ -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

WBR, Sergei

#3 lore raw

PATCH 2/2 usb: ci_hdrc_imx doc: fsl,usbphy is required

Hi,

Quoted 12 lines · Sergei Shtylyov

Hello.

Quoted 7 lines · Markus Pargmann

fsl,usbphy is no optional property. This patch moves it to the list of required properties.

---
 Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines

Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt Required properties: · line 7

Quoted 9 lines
Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt +1 -0
index a6a32cb7f777..8014d0d050f8 100644
@@ -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: phandler of usb phy that connects to the only one port

s/phandler/phandle/. Can fix, while at it...

Yes, right, I will fix it and resend.

Thanks,

Markus

Signature · 11 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140709/27181e9e/attachment.sig>