u-boot/drivers/phy
Jonas Karlman 14639bf14d phy: Set phy->dev to NULL when generic_phy_get_by_index_nodev() fails
Generic phy helpers typically use generic_phy_valid() to determine if
the helper should perform its function on a passed struct phy.
generic_phy_valid() treat any struct phy having phy->dev set as valid.

With generic_phy_get_by_index_nodev() setting phy->dev to a valid struct
udevice early, there can be situations where the struct phy is returned
as valid when initialization in fact failed and returned an error.

Fix this by setting phy->dev back to NULL when any of the calls to
of_xlate ops, device_get_supply_regulator or phy_alloc_counts fail. Also
extend the dm_test_phy_base test with a test where of_xlate ops fail.

Fixes: 72e5016f87 ("drivers: phy: add generic PHY framework")
Fixes: b9688df3cb ("drivers: phy: Set phy->dev to NULL when generic_phy_get_by_index() fails")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2023-09-13 15:52:20 -04:00
..
allwinner phy: sun4i: Add H616 USB PHY support 2023-07-21 00:28:13 +01:00
cadence phy: cadence: Sierra: Move the link operations from serdes phy to link device 2022-03-14 12:44:51 -04:00
marvell global: Use proper project name U-Boot 2023-06-12 13:24:31 +02:00
qcom drivers: use dev_read_addr_ptr when cast to pointer 2023-05-06 17:28:18 +08:00
renesas phy: renesas: Add Renesas Ethernet SERDES driver for R-Car S4-8 2023-04-16 16:18:29 +02:00
rockchip phy: rockchip-inno-usb2: Add USB2 PHY for RK3328 2023-07-31 20:33:18 +08:00
socionext phy: socionext: Add UniPhier USB3 PHY driver 2023-02-22 19:40:11 +01:00
ti phy: ti: j721e-wiz: Add SGMII support in WIZ driver for J721E 2023-08-15 17:46:39 -04:00
bcm6318-usbh-phy.c phy: bcm63xx: Don't check clk_free 2022-03-30 13:02:55 -04:00
bcm6348-usbh-phy.c phy: bcm63xx: Don't check clk_free 2022-03-30 13:02:55 -04:00
bcm6358-usbh-phy.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
bcm6368-usbh-phy.c phy: bcm63xx: Don't check clk_free 2022-03-30 13:02:55 -04:00
Kconfig phy: Add support for the Apple Type-C PHY 2023-08-14 17:51:51 -04:00
keystone-usb-phy.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
Makefile phy: Add support for the Apple Type-C PHY 2023-08-14 17:51:51 -04:00
meson-axg-mipi-dphy.c phy: meson-axg-mipi: Rename "priv_auto_alloc_size" to "priv_auto" 2021-07-27 10:32:09 +02:00
meson-axg-mipi-pcie-analog.c phy: meson-axg-mipi: Access parent ofnode through dev_ofnode() 2021-07-27 10:32:09 +02:00
meson-g12a-usb2.c phy: remove phy-supply related code 2023-05-17 17:36:18 +08:00
meson-g12a-usb3-pcie.c phy: meson-g12a-usb3-pcie: add support for PCIe ops 2021-04-19 16:59:33 +02:00
meson-gxbb-usb2.c phy: remove phy-supply related code 2023-05-17 17:36:18 +08:00
meson-gxl-usb2.c phy: remove phy-supply related code 2023-05-17 17:36:18 +08:00
mt76x8-usb-phy.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
mt7620-usb-phy.c phy: add USB PHY driver for MediaTek MT7620 SoC 2021-01-24 21:39:26 +01:00
nop-phy.c phy: nop-phy: Fix phy reset if no reset-gpio defined 2022-03-01 00:21:11 +01:00
omap-usb2-phy.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
phy-ab8500-usb.c Correct SPL uses of USB_MUSB_HOST 2023-02-10 07:41:40 -05:00
phy-apple-atc.c phy: Add support for the Apple Type-C PHY 2023-08-14 17:51:51 -04:00
phy-bcm-sr-pcie.c dm: treewide: Rename 'platdata' variables to just 'plat' 2020-12-13 16:51:08 -07:00
phy-core-mipi-dphy.c phy: dphy: Add configuration helpers 2021-02-10 10:00:51 +01:00
phy-da8xx-usb.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
phy-imx8mq-usb.c phy: phy-imx8mq-usb: clean up clock code 2023-08-25 02:36:19 +02:00
phy-mtk-tphy.c phy: phy-mtk-tphy: add support mt8195 2023-03-02 22:43:43 +01:00
phy-npcm-usb.c phy: nuvoton: add NPCM7xx phy control driver 2022-07-06 14:30:51 -04:00
phy-rcar-gen2.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
phy-rcar-gen3.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
phy-stm32-usbphyc.c drivers: fix debug string with fdt_addr_t input 2023-05-06 17:28:18 +08:00
phy-ti-am654.c arm: mach-k3: Remove empty sys_proto.h include 2023-04-24 13:18:48 -04:00
phy-uclass.c phy: Set phy->dev to NULL when generic_phy_get_by_index_nodev() fails 2023-09-13 15:52:20 -04:00
phy-zynqmp.c phy: zynqmp: Increase timeout value to 10ms 2022-05-18 13:17:54 +02:00
sandbox-phy.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
sti_usb_phy.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
ti-pipe3-phy.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00