summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/hci_bcm.c
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2018-12-17 05:04:39 +0100
committerMarcel Holtmann <marcel@holtmann.org>2018-12-19 00:28:38 +0100
commit28ac03b9ac3f784c2f048a910c8d0a7a87483b66 (patch)
treea32a39a3e365623d2c4bc8e4162fa0e2a4084184 /drivers/bluetooth/hci_bcm.c
parentdt-bindings: net: broadcom-bluetooth: Add BCM4330 compatible string (diff)
downloadlinux-28ac03b9ac3f784c2f048a910c8d0a7a87483b66.tar.xz
linux-28ac03b9ac3f784c2f048a910c8d0a7a87483b66.zip
Bluetooth: hci_bcm: Handle deferred probing for the clock supply
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>
Diffstat (limited to 'drivers/bluetooth/hci_bcm.c')
-rw-r--r--drivers/bluetooth/hci_bcm.c4
1 files changed, 4 insertions, 0 deletions
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))