Commit f3d63f50 authored by Venkata Lakshmi Narayana Gubba's avatar Venkata Lakshmi Narayana Gubba Committed by Marcel Holtmann

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: default avatarVenkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 2ade42d8
...@@ -1756,13 +1756,10 @@ static int qca_regulator_enable(struct qca_serdev *qcadev) ...@@ -1756,13 +1756,10 @@ static int qca_regulator_enable(struct qca_serdev *qcadev)
power->vregs_on = true; power->vregs_on = true;
ret = clk_prepare_enable(qcadev->susclk); ret = clk_prepare_enable(qcadev->susclk);
if (ret) { if (ret)
/* Turn off regulators to overcome power leakage */
qca_regulator_disable(qcadev); qca_regulator_disable(qcadev);
return ret;
}
return 0; return ret;
} }
static void qca_regulator_disable(struct qca_serdev *qcadev) static void qca_regulator_disable(struct qca_serdev *qcadev)
...@@ -1781,8 +1778,7 @@ 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); regulator_bulk_disable(power->num_vregs, power->vreg_bulk);
power->vregs_on = false; 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, static int qca_init_regulators(struct qca_power *qca,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment