* [PATCH AUTOSEL 4.20 220/304] Bluetooth: hci_bcm: Handle deferred probing for the clock supply
[not found] <20190128154341.47195-1-sashal@kernel.org>
@ 2019-01-28 15:42 ` Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2019-01-28 15:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Chen-Yu Tsai, Marcel Holtmann, Sasha Levin, linux-bluetooth
From: Chen-Yu Tsai <wens@csie.org>
[ Upstream commit 28ac03b9ac3f784c2f048a910c8d0a7a87483b66 ]
On some systems that actually have the bluetooth controller wired up
with an extra clock signal, it's possible the bluetooth controller
probes before the clock provider. clk_get would return a defer probe
error, which was not handled by this driver.
Handle this properly, so that these systems can work reliably.
Tested-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/bluetooth/hci_bcm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index ddbd8c6a0ceb..800132369134 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -907,6 +907,10 @@ static int bcm_get_resources(struct bcm_device *dev)
dev->clk = devm_clk_get(dev->dev, NULL);
+ /* Handle deferred probing */
+ if (dev->clk == ERR_PTR(-EPROBE_DEFER))
+ return PTR_ERR(dev->clk);
+
dev->device_wakeup = devm_gpiod_get_optional(dev->dev, "device-wakeup",
GPIOD_OUT_LOW);
if (IS_ERR(dev->device_wakeup))
--
2.19.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-01-28 15:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20190128154341.47195-1-sashal@kernel.org>
2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 220/304] Bluetooth: hci_bcm: Handle deferred probing for the clock supply Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).