drivers/amba: fix reset control error handling
authorRussell King <rmk+kernel@armlinux.org.uk>
Wed, 2 Oct 2019 16:45:11 +0000 (17:45 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Wed, 9 Oct 2019 21:59:30 +0000 (22:59 +0100)
commite963408e8ff439e2b9da20e5399d7dca21462fcc
tree80ac163694a675256ace64c1a02c92376d22c29b
parent79bdcb202a35bf2701779afafa0db07e2852d46b
drivers/amba: fix reset control error handling

With commit 79bdcb202a35 ("ARM: 8906/1: drivers/amba: add reset control
to amba bus probe") it is possible for the the amba bus driver to defer
probing the device for its IDs because the reset driver may be probed
later.

However when a subsequent probe occurs, the call to request_resource()
in the driver returns -EBUSY as the driver has not released the resource
from the initial probe attempt - or cleaned up any of the preceding
actions.

Fix this both for the deferred probe case as well as a failure to get
the reset.

Fixes: 79bdcb202a35 ("ARM: 8906/1: drivers/amba: add reset control to amba bus probe")
Reported-by: Dinh Nguyen <dinguyen@kernel.org>
Tested-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
drivers/amba/bus.c