]> git.baikalelectronics.ru Git - uboot.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)
commit991a45ecd62d8513e815acf5169226d89d2d9a1f
tree0b25b6b9ea6a0c75a684743065bdc826dda911ac
parentf5b98e0805387d73106d0303aea94e78771dc845
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 7435dbd843e8 ("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