]> git.dujemihanovic.xyz Git - u-boot.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)
commite04b67a7f4c1c326bf8c9376c0c7ba5ed9e5075d
tree8b6562966321447e59df0b2624b2146bf38129ba
parent6cf6fe25370c8d96e02488ef8779e295ecdb982d
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