linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_ll: Use the devm_clk_get_optional() helper
@ 2023-05-20 15:17 Christophe JAILLET
  2023-05-20 15:56 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2023-05-20 15:17 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-bluetooth

Use devm_clk_get_optional() instead of hand writing it.
This is slightly less verbose and improves the semantic.

This also simplifies ll_open() because clk_prepare_enable() already handles
NULL clk.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/bluetooth/hci_ll.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index 4a0b5c3160c2..de463d8bf265 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -129,8 +129,7 @@ static int ll_open(struct hci_uart *hu)
 	if (hu->serdev) {
 		struct ll_device *lldev = serdev_device_get_drvdata(hu->serdev);
 
-		if (!IS_ERR(lldev->ext_clk))
-			clk_prepare_enable(lldev->ext_clk);
+		clk_prepare_enable(lldev->ext_clk);
 	}
 
 	return 0;
@@ -703,8 +702,8 @@ static int hci_ti_probe(struct serdev_device *serdev)
 	if (IS_ERR(lldev->enable_gpio))
 		return PTR_ERR(lldev->enable_gpio);
 
-	lldev->ext_clk = devm_clk_get(&serdev->dev, "ext_clock");
-	if (IS_ERR(lldev->ext_clk) && PTR_ERR(lldev->ext_clk) != -ENOENT)
+	lldev->ext_clk = devm_clk_get_optional(&serdev->dev, "ext_clock");
+	if (IS_ERR(lldev->ext_clk))
 		return PTR_ERR(lldev->ext_clk);
 
 	of_property_read_u32(serdev->dev.of_node, "max-speed", &max_speed);
-- 
2.34.1


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

* RE: Bluetooth: hci_ll: Use the devm_clk_get_optional() helper
  2023-05-20 15:17 [PATCH] Bluetooth: hci_ll: Use the devm_clk_get_optional() helper Christophe JAILLET
@ 2023-05-20 15:56 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2023-05-20 15:56 UTC (permalink / raw)
  To: linux-bluetooth, christophe.jaillet

[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=749494

---Test result---

Test Summary:
CheckPatch                    PASS      0.72 seconds
GitLint                       PASS      0.36 seconds
SubjectPrefix                 PASS      0.14 seconds
BuildKernel                   PASS      32.27 seconds
CheckAllWarning               PASS      35.06 seconds
CheckSparse                   PASS      39.96 seconds
CheckSmatch                   PASS      108.89 seconds
BuildKernel32                 PASS      31.10 seconds
TestRunnerSetup               PASS      446.95 seconds
TestRunner_l2cap-tester       PASS      17.26 seconds
TestRunner_iso-tester         PASS      21.31 seconds
TestRunner_bnep-tester        PASS      5.71 seconds
TestRunner_mgmt-tester        PASS      116.57 seconds
TestRunner_rfcomm-tester      PASS      9.09 seconds
TestRunner_sco-tester         PASS      8.35 seconds
TestRunner_ioctl-tester       PASS      9.72 seconds
TestRunner_mesh-tester        PASS      7.16 seconds
TestRunner_smp-tester         PASS      8.31 seconds
TestRunner_userchan-tester    PASS      5.99 seconds
IncrementalBuild              PASS      29.29 seconds



---
Regards,
Linux Bluetooth


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

end of thread, other threads:[~2023-05-20 15:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-20 15:17 [PATCH] Bluetooth: hci_ll: Use the devm_clk_get_optional() helper Christophe JAILLET
2023-05-20 15:56 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).