u-boot/arch
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
..
arc treewide: unify the linker symbol reference format 2023-08-09 09:21:42 -04:00
arm Watchdog: Support WDIOF_CARDRESET on TI AM65x platform 2023-09-08 10:07:12 -04:00
m68k arch: m68k: Implement relocation 2023-09-06 13:28:58 +02:00
microblaze treewide: rework linker symbol declarations in sections header 2023-08-09 09:21:42 -04:00
mips event: Use an event to replace last_stage_init() 2023-08-31 13:16:55 -04:00
nios2 event: Convert existing spy records to simple 2023-08-31 13:16:54 -04:00
powerpc Kconfigs: Correct default of "0" on hex type entries 2023-08-09 09:21:42 -04:00
riscv riscv: Correct event usage for riscv_cpu_probe/setup 2023-09-06 13:47:24 -04:00
sandbox phy: Set phy->dev to NULL when generic_phy_get_by_index_nodev() fails 2023-09-13 15:52:20 -04:00
sh sh: use asm-generic/unaligned.h 2023-05-31 14:05:34 -04:00
x86 event: Use an event to replace last_stage_init() 2023-08-31 13:16:55 -04:00
xtensa treewide: unify the linker symbol reference format 2023-08-09 09:21:42 -04:00
.gitignore
Kconfig arch: m68k: Implement relocation 2023-09-06 13:28:58 +02:00
Kconfig.nxp LFU-544: Kconfig.nxp: Fixed secure boot on LS-CH2 platforms 2023-07-06 13:04:56 +08:00
u-boot-elf.lds