]> git.baikalelectronics.ru Git - uboot.git/commit
pci: pcie_dw_rockchip: release resources on failing probe
authorEugen Hristev <eugen.hristev@collabora.com>
Thu, 13 Apr 2023 14:11:03 +0000 (17:11 +0300)
committerKever Yang <kever.yang@rock-chips.com>
Tue, 9 May 2023 10:26:59 +0000 (18:26 +0800)
commit7435dbd843e89d3b8aeb7367845a18c43d5c6d27
tree8b6562966321447e59df0b2624b2146bf38129ba
parent0526d99efe749104c6c39de5c959a39abbdb409e
pci: pcie_dw_rockchip: release resources on failing probe

Implement a resource release mechanism on failing probe.
Without this, a strange situation can happen e.g. when init port fails,
or attempting to get the PHY fails, because the gpios have been
requested first, and if the user tries to do 'pci enum' again, the
driver will fail with 'can't find reset gpios' even if the gpios are
there, just because they were blocked by a previous probe attempt.
It is only natural to release the acquired resources if the probe fails,
just for consistency if nothing else.
This way on subsequent probe attempts, the user will get the same error
message, and not something different that doesn't make sense.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
drivers/pci/pcie_dw_rockchip.c