[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191001214026.21718-1-dinguyen@kernel.org>
Date: Tue, 1 Oct 2019 16:40:26 -0500
From: Dinh Nguyen <dinguyen@...nel.org>
To: linux@...linux.org.uk
Cc: dinguyen@...nel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linus.walleij@...aro.org,
p.zabel@...gutronix.de, thor.thayer@...ux.intel.com
Subject: [PATCH] ARM: drivers/amba: release the resource to allow for deferred probe
With commit "79bdcb202a35 ARM: 8906/1: drivers/amba: add reset control to
amba bus probe", the amba bus driver needs to be deferred probe because the
reset driver is probed later than the amba bus. However with a deferred
probe, the call to request_resource() in the driver returns -EBUSY. The
reason is the driver has not released the resource from the previous probe
attempt.
This patch releases the resource when amba_device_try_add() returns
-EPROBE_DEFER. This allows the deferred probe to continue.
Fixes: 79bdcb202a35 ("ARM: 8906/1: drivers/amba: add reset control to
amba bus probe")
Signed-off-by: Dinh Nguyen <dinguyen@...nel.org>
---
drivers/amba/bus.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index f39f075abff9..f246b847c991 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -535,6 +535,7 @@ int amba_device_add(struct amba_device *dev, struct resource *parent)
if (ret == -EPROBE_DEFER) {
struct deferred_device *ddev;
+ release_resource(&dev->res);
ddev = kmalloc(sizeof(*ddev), GFP_KERNEL);
if (!ddev)
--
2.20.0
Powered by blists - more mailing lists