diff mbox series

[RESEND] Bluetooth: hci_qca: use devm_clk_get_optional_enabled_with_rate()

Message ID 20240930080938.12505-1-brgl@bgdev.pl (mailing list archive)
State Accepted
Commit 5fe50b4b2d0c89c95cf9dbf9a1c527980c2a83f6
Headers show
Series [RESEND] Bluetooth: hci_qca: use devm_clk_get_optional_enabled_with_rate() | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/SubjectPrefix success Gitlint PASS
tedd_an/BuildKernel fail BuildKernel: FAIL: drivers/bluetooth/hci_qca.c: In function ‘qca_serdev_probe’: drivers/bluetooth/hci_qca.c:2429:20: error: implicit declaration of function ‘devm_clk_get_optional_enabled_with_rate’; did you mean ‘devm_clk_get_optional_enabled’? [-Werror=implicit-function-declaration] 2429 | qcadev->susclk = devm_clk_get_optional_enabled_with_rate( | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | devm_clk_get_optional_enabled drivers/bluetooth/hci_qca.c:2429:18: warning: assignment to ‘struct clk *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 2429 | qcadev->susclk = devm_clk_get_optional_enabled_with_rate( | ^ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/hci_qca.o] Error 1 make[3]: *** [scripts/Makefile.build:485: drivers/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:485: drivers] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/github/workspace/src/src/Makefile:1926: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2
tedd_an/CheckAllWarning fail CheckAllWarning: FAIL: drivers/bluetooth/hci_qca.c: In function ‘qca_serdev_probe’: drivers/bluetooth/hci_qca.c:2429:20: error: implicit declaration of function ‘devm_clk_get_optional_enabled_with_rate’; did you mean ‘devm_clk_get_optional_enabled’? [-Werror=implicit-function-declaration] 2429 | qcadev->susclk = devm_clk_get_optional_enabled_with_rate( | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | devm_clk_get_optional_enabled drivers/bluetooth/hci_qca.c:2429:18: warning: assignment to ‘struct clk *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 2429 | qcadev->susclk = devm_clk_get_optional_enabled_with_rate( | ^ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/hci_qca.o] Error 1 make[3]: *** [scripts/Makefile.build:485: drivers/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:485: drivers] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/github/workspace/src/src/Makefile:1926: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2
tedd_an/CheckSparse fail CheckSparse: FAIL: net/bluetooth/af_bluetooth.c:223:25: warning: context imbalance in 'bt_accept_enqueue' - different lock contexts for basic block drivers/bluetooth/hci_qca.c: In function ‘qca_serdev_probe’: drivers/bluetooth/hci_qca.c:2429:20: error: implicit declaration of function ‘devm_clk_get_optional_enabled_with_rate’; did you mean ‘devm_clk_get_optional_enabled’? [-Werror=implicit-function-declaration] 2429 | qcadev->susclk = devm_clk_get_optional_enabled_with_rate( | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | devm_clk_get_optional_enabled drivers/bluetooth/hci_qca.c:2429:18: warning: assignment to ‘struct clk *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 2429 | qcadev->susclk = devm_clk_get_optional_enabled_with_rate( | ^ cc1: some warnings being treated as errors make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/hci_qca.o] Error 1 make[3]: *** [scripts/Makefile.build:485: drivers/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:485: drivers] Error 2 make[2]: *** Waiting for unfinished jobs.... net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h): ./include/net/bluetooth/hci.h:2599:47: warning: array of flexible structures ./include/net/bluetooth/hci.h:2685:43: warning: array of flexible structures net/bluetooth/hci_codec.c: note: in included file: ./include/net/bluetooth/hci_core.h:147:35: warning: array of flexible structures net/bluetooth/sco.c: note: in included file: ./include/net/bluetooth/hci_core.h:147:35: warning: array of flexible structures make[1]: *** [/github/workspace/src/src/Makefile:1926: .] Error 2 make: *** [Makefile:224: __sub-make] Error 2

Commit Message

Bartosz Golaszewski Sept. 30, 2024, 8:09 a.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Use the new devm_clk_get_optional_enabled_with_rate() clock helper to
shrink the code a bit.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
Resending now that devm_clk_get_optional_enabled_with_rate() is in
mainline.

 drivers/bluetooth/hci_qca.c | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

Comments

Bartosz Golaszewski Oct. 14, 2024, 8:36 a.m. UTC | #1
On Mon, Sep 30, 2024 at 10:09 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> Use the new devm_clk_get_optional_enabled_with_rate() clock helper to
> shrink the code a bit.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---

It's been two weeks, gentle ping.

Bart
patchwork-bot+bluetooth@kernel.org Oct. 16, 2024, 7:06 p.m. UTC | #2
Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon, 30 Sep 2024 10:09:38 +0200 you wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> Use the new devm_clk_get_optional_enabled_with_rate() clock helper to
> shrink the code a bit.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> [...]

Here is the summary with links:
  - [RESEND] Bluetooth: hci_qca: use devm_clk_get_optional_enabled_with_rate()
    https://git.kernel.org/bluetooth/bluetooth-next/c/5fe50b4b2d0c

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 678f150229e7..ad40118c9f82 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -2294,13 +2294,6 @@  static int qca_init_regulators(struct qca_power *qca,
 	return 0;
 }
 
-static void qca_clk_disable_unprepare(void *data)
-{
-	struct clk *clk = data;
-
-	clk_disable_unprepare(clk);
-}
-
 static int qca_serdev_probe(struct serdev_device *serdev)
 {
 	struct qca_serdev *qcadev;
@@ -2433,25 +2426,12 @@  static int qca_serdev_probe(struct serdev_device *serdev)
 		if (!qcadev->bt_en)
 			power_ctrl_enabled = false;
 
-		qcadev->susclk = devm_clk_get_optional(&serdev->dev, NULL);
+		qcadev->susclk = devm_clk_get_optional_enabled_with_rate(
+					&serdev->dev, NULL, SUSCLK_RATE_32KHZ);
 		if (IS_ERR(qcadev->susclk)) {
 			dev_warn(&serdev->dev, "failed to acquire clk\n");
 			return PTR_ERR(qcadev->susclk);
 		}
-		err = clk_set_rate(qcadev->susclk, SUSCLK_RATE_32KHZ);
-		if (err)
-			return err;
-
-		err = clk_prepare_enable(qcadev->susclk);
-		if (err)
-			return err;
-
-		err = devm_add_action_or_reset(&serdev->dev,
-					       qca_clk_disable_unprepare,
-					       qcadev->susclk);
-		if (err)
-			return err;
-
 	}
 	
 	err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto);