Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v1] Bluetooth: hci_qca: Optimized code while enabling clocks for BT SOC
@ 2020-02-05 10:51 Venkata Lakshmi Narayana Gubba
  2020-02-05 11:50 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Venkata Lakshmi Narayana Gubba @ 2020-02-05 10:51 UTC (permalink / raw)
  To: marcel, johan.hedberg
  Cc: mka, linux-kernel, linux-bluetooth, robh, hemantg, linux-arm-msm,
	bgodavar, tientzu, seanpaul, rjliao, yshavit, devicetree,
	Venkata Lakshmi Narayana Gubba

* 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>
---
 drivers/bluetooth/hci_qca.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index eacc65b..8e95bfe 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,
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] Bluetooth: hci_qca: Optimized code while enabling clocks for BT SOC
  2020-02-05 10:51 [PATCH v1] Bluetooth: hci_qca: Optimized code while enabling clocks for BT SOC Venkata Lakshmi Narayana Gubba
@ 2020-02-05 11:50 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2020-02-05 11:50 UTC (permalink / raw)
  To: Venkata Lakshmi Narayana Gubba
  Cc: Johan Hedberg, Matthias Kaehlcke, linux-kernel, linux-bluetooth,
	robh, hemantg, linux-arm-msm, bgodavar, tientzu, seanpaul,
	rjliao, yshavit, devicetree

Hi Venkata,

> * 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>
> ---
> drivers/bluetooth/hci_qca.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 10:51 [PATCH v1] Bluetooth: hci_qca: Optimized code while enabling clocks for BT SOC Venkata Lakshmi Narayana Gubba
2020-02-05 11:50 ` Marcel Holtmann

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org
	public-inbox-index linux-bluetooth

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git