linux/drivers/usb/phy
Thierry Reding c818a94c77 usb: phy: Restore deferred probing path
Commit 1290a958d4 ("usb: phy: propagate __of_usb_find_phy()'s error on
failure") broke platforms that rely on deferred probing to order probing
of PHY and host controller drivers. The reason is that the commit simply
propagates errors from __of_usb_find_phy(), which returns -ENODEV if no
PHY has been registered yet for a given device tree node. The only case
in which -EPROBE_DEFER would now be returned is if try_module_get() did
fail, which does not make sense.

The correct thing to do is to return -EPROBE_DEFER if a PHY hasn't been
registered yet. The only condition under which it makes sense to return
-ENODEV is if the device tree node representing the PHY has been
disabled (via the status property) because in that case the PHY will
never be registered.

This patch addresses the problem by making __of_usb_find_phy() return an
appropriate error code while keeping in line with the above-mentioned
commit to propagate error codes rather than overwriting them. At the
same time the check for a valid PHY is decoupled from the check for the
try_module_get() call and a separate error code is returned if the
latter fails.

Fixes: 1290a95 (usb: phy: propagate __of_usb_find_phy()'s error on failure)
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-12-23 12:37:16 -06:00
..
am35x-phy-control.h usb: phy: Add AM335x PHY driver 2013-08-09 17:34:15 +03:00
Kconfig PM / Kconfig: Replace PM_RUNTIME with PM in dependencies 2014-12-13 00:44:04 +01:00
Makefile usb: phy: samsung: remove old USB 3.0 PHY driver 2014-09-02 09:16:44 -05:00
of.c usb: add devicetree helpers for determining dr_mode and phy_type 2013-06-17 13:47:09 -07:00
phy-ab8500-usb.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
phy-am335x-control.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
phy-am335x.c usb: phy: drop owner assignment from platform_drivers 2014-10-20 16:21:50 +02:00
phy-fsl-usb.c usb: phy: fsl: Fix build errors 2014-11-12 08:37:37 -06:00
phy-fsl-usb.h usb: phy: fsl: Fix build errors 2014-11-12 08:37:37 -06:00
phy-generic.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
phy-generic.h usb: phy: rename <linux/usb/usb_phy_gen_xceiv.h> to <linux/usb/usb_phy_generic.h> 2014-04-21 14:07:24 -05:00
phy-gpio-vbus-usb.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
phy-isp1301-omap.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
phy-isp1301.c usb: phy: Fix NULL pointer exception during usb_get_phy 2013-05-15 17:32:47 +03:00
phy-keystone.c usb: phy: drop owner assignment from platform_drivers 2014-10-20 16:21:50 +02:00
phy-msm-usb.c USB patches for 3.19-rc1 2014-12-14 14:57:16 -08:00
phy-mv-usb.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
phy-mv-usb.h
phy-mxs-usb.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
phy-omap-otg.c usb: phy: drop owner assignment from platform_drivers 2014-10-20 16:21:50 +02:00
phy-rcar-gen2-usb.c usb: phy: phy-rcar-gen2-usb: delete unnecessary 'out of memory' messages 2014-11-03 10:01:05 -06:00
phy-rcar-usb.c usb: phy: rcar-usb: remove duplicate check on resource 2014-11-03 10:01:21 -06:00
phy-tahvo.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
phy-tegra-usb.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
phy-twl6030-usb.c usb: phy: drop owner assignment from platform_drivers 2014-10-20 16:21:50 +02:00
phy-ulpi-viewport.c usb: Remove unnecessary semicolons 2013-10-11 16:26:46 -07:00
phy-ulpi.c usb: rename phy to usb_phy in OTG 2014-11-03 10:01:25 -06:00
phy.c usb: phy: Restore deferred probing path 2014-12-23 12:37:16 -06:00