]> git.dujemihanovic.xyz Git - u-boot.git/commit
pci: rockchip: Release resources on failing probe
authorJonas Karlman <jonas@kwiboo.se>
Tue, 11 Jul 2023 23:13:56 +0000 (23:13 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Sat, 12 Aug 2023 01:59:18 +0000 (09:59 +0800)
commit0e2474f55001e00e966be50595e7e0e055255006
tree0b25b6b9ea6a0c75a684743065bdc826dda911ac
parente5422ea51290db9de0d3a48ec4bfbdf6d27c2662
pci: rockchip: Release resources on failing probe

The PCIe driver for RK3399 is affected by a similar issue that was fixed
for RK35xx in the commit e04b67a7f4c1 ("pci: pcie_dw_rockchip: release
resources on failing probe").

Resources are not released on failing probe, e.g. regulators may be left
enabled and the ep-gpio may be left in a requested state.

Change to use regulator_set_enable_if_allowed and disable regulators
after failure to keep regulator enable count balanced, ep-gpio is also
released on regulator failure.

Also add support for the vpcie12v-supply, remove unused include and
check return value from dev_read_addr_name.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
drivers/pci/pcie_rockchip.c