u-boot/arch/sandbox
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
..
cpu event: Convert existing spy records to simple 2023-08-31 13:16:54 -04:00
dts phy: Set phy->dev to NULL when generic_phy_get_by_index_nodev() fails 2023-09-13 15:52:20 -04:00
include/asm arm_ffa: introduce sandbox FF-A support 2023-08-08 10:22:03 -04:00
lib Correct SPL uses of LMB 2023-02-10 07:41:39 -05:00
config.mk sandbox: Drop reference to CONFIG_ARCH_DEVICE_TREE 2023-02-07 14:33:47 -05:00
Kconfig sandbox: Rework how SDL is enabled / disabled 2022-12-05 16:11:50 -05:00
Makefile sandbox: fix build failure with musl and SDL 2022-02-09 12:26:12 -07:00