Skip to contentSkip to conversation

Bluetooth: hci_qca: Optimized code while enabling clocks for BT SOC

PATCH In review Venkata Lakshmi Narayana Gubba 2 participants 2 messages Feb 5, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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()

---
 drivers/bluetooth/hci_qca.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/bluetooth/hci_qca.c +3 -7
index eacc65b..8e95bfe 100644
@@ -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,
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation
maintainer
#1 lore raw

Hi Venkata,

Quoted 9 lines

* 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()

---
drivers/bluetooth/hci_qca.c | 10 +++-------

1 file changed, 3 insertions(+), 7 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel