public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: luiz.dentz@gmail.com
Cc: amitkumar.karwar@nxp.com, neeraj.sanjaykale@nxp.com,
	marcel@holtmann.org, linux-bluetooth@vger.kernel.org,
	linux-kernel@vger.kernel.org, Fabio Estevam <festevam@denx.de>
Subject: [PATCH] Bluetooth: btnxpuart: Switch to SYSTEM_SLEEP_PM_OPS
Date: Fri, 22 Nov 2024 10:59:39 -0300	[thread overview]
Message-ID: <20241122135939.337327-1-festevam@gmail.com> (raw)

From: Fabio Estevam <festevam@denx.de>

Replace SET_SYSTEM_SLEEP_PM_OPS() with its modern SYSTEM_SLEEP_PM_OPS()
alternative.

The combined usage of pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() allows
the compiler to evaluate if the suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the CONFIG_PM_SLEEP ifdefery from the
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 drivers/bluetooth/btnxpuart.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index 569f5b7d6e46..06c1093c70ab 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -1588,7 +1588,6 @@ static void nxp_serdev_remove(struct serdev_device *serdev)
 	hci_free_dev(hdev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int nxp_serdev_suspend(struct device *dev)
 {
 	struct btnxpuart_dev *nxpdev = dev_get_drvdata(dev);
@@ -1606,7 +1605,6 @@ static int nxp_serdev_resume(struct device *dev)
 	ps_control(psdata->hdev, PS_STATE_AWAKE);
 	return 0;
 }
-#endif
 
 static struct btnxpuart_data w8987_data __maybe_unused = {
 	.helper_fw_name = NULL,
@@ -1628,7 +1626,7 @@ static const struct of_device_id nxpuart_of_match_table[] __maybe_unused = {
 MODULE_DEVICE_TABLE(of, nxpuart_of_match_table);
 
 static const struct dev_pm_ops nxp_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(nxp_serdev_suspend, nxp_serdev_resume)
+	SYSTEM_SLEEP_PM_OPS(nxp_serdev_suspend, nxp_serdev_resume)
 };
 
 static struct serdev_device_driver nxp_serdev_driver = {
@@ -1637,7 +1635,7 @@ static struct serdev_device_driver nxp_serdev_driver = {
 	.driver = {
 		.name = "btnxpuart",
 		.of_match_table = of_match_ptr(nxpuart_of_match_table),
-		.pm = &nxp_pm_ops,
+		.pm = pm_sleep_ptr(&nxp_pm_ops),
 	},
 };
 
-- 
2.34.1


             reply	other threads:[~2024-11-22 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 13:59 Fabio Estevam [this message]
2024-11-22 14:31 ` Bluetooth: btnxpuart: Switch to SYSTEM_SLEEP_PM_OPS bluez.test.bot
2024-11-26 13:47 ` [PATCH] " Neeraj Sanjay Kale

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241122135939.337327-1-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=amitkumar.karwar@nxp.com \
    --cc=festevam@denx.de \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=neeraj.sanjaykale@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox