summaryrefslogtreecommitdiff
path: root/drivers/bluetooth/hci_qca.c
diff options
context:
space:
mode:
authorVenkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>2020-02-05 13:51:43 +0300
committerMarcel Holtmann <marcel@holtmann.org>2020-02-05 14:49:55 +0300
commitf3d63f50c17af70b4aa7d25a9c359ca318365173 (patch)
tree2b5b1f315e8b4f39c47f8613f93b3cdea078ac08 /drivers/bluetooth/hci_qca.c
parent2ade42d88fdbb0af37dfdcaae8e5246f7b5b6e9b (diff)
downloadlinux-f3d63f50c17af70b4aa7d25a9c359ca318365173.tar.xz
Bluetooth: hci_qca: Optimized code while enabling clocks for BT SOC
* Directly passing clock pointer to clock code without checking for NULL as clock code takes care of it * Removed the comment which was not necessary * Updated code for return in qca_regulator_enable() Signed-off-by: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/hci_qca.c')
-rw-r--r--drivers/bluetooth/hci_qca.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index eacc65b02b30..8e95bfe750d4 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1756,13 +1756,10 @@ static int qca_regulator_enable(struct qca_serdev *qcadev)
power->vregs_on = true;
ret = clk_prepare_enable(qcadev->susclk);
- if (ret) {
- /* Turn off regulators to overcome power leakage */
+ if (ret)
qca_regulator_disable(qcadev);
- return ret;
- }
- return 0;
+ return ret;
}
static void qca_regulator_disable(struct qca_serdev *qcadev)
@@ -1781,8 +1778,7 @@ static void qca_regulator_disable(struct qca_serdev *qcadev)
regulator_bulk_disable(power->num_vregs, power->vreg_bulk);
power->vregs_on = false;
- if (qcadev->susclk)
- clk_disable_unprepare(qcadev->susclk);
+ clk_disable_unprepare(qcadev->susclk);
}
static int qca_init_regulators(struct qca_power *qca,