From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>
Subject: [PATCH v3 6/8] serial: max3100: Switch to DEFINE_SIMPLE_DEV_PM_OPS()
Date: Tue, 9 Apr 2024 17:45:53 +0300 [thread overview]
Message-ID: <20240409144721.638326-7-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20240409144721.638326-1-andriy.shevchenko@linux.intel.com>
The SIMPLE_DEV_PM_OPS() is deprecated, replace it with the
DEFINE_SIMPLE_DEV_PM_OPS() and use pm_sleep_ptr() for setting
the driver's PM routines.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/tty/serial/max3100.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index 3004a95e573f..db543eaa39c8 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -21,6 +21,7 @@
#include <linux/device.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
+#include <linux/pm.h>
#include <linux/property.h>
#include <linux/serial_core.h>
#include <linux/serial.h>
@@ -797,8 +798,6 @@ static void max3100_remove(struct spi_device *spi)
mutex_unlock(&max3100s_lock);
}
-#ifdef CONFIG_PM_SLEEP
-
static int max3100_suspend(struct device *dev)
{
struct max3100_port *s = dev_get_drvdata(dev);
@@ -834,12 +833,7 @@ static int max3100_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(max3100_pm_ops, max3100_suspend, max3100_resume);
-#define MAX3100_PM_OPS (&max3100_pm_ops)
-
-#else
-#define MAX3100_PM_OPS NULL
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(max3100_pm_ops, max3100_suspend, max3100_resume);
static const struct spi_device_id max3100_spi_id[] = {
{ "max3100" },
@@ -857,7 +851,7 @@ static struct spi_driver max3100_driver = {
.driver = {
.name = "max3100",
.of_match_table = max3100_of_match,
- .pm = MAX3100_PM_OPS,
+ .pm = pm_sleep_ptr(&max3100_pm_ops),
},
.probe = max3100_probe,
.remove = max3100_remove,
--
2.43.0.rc1.1.gbec44491f096
next prev parent reply other threads:[~2024-04-09 14:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-09 14:45 [PATCH v3 0/8] serial: max3100: Put into shape Andy Shevchenko
2024-04-09 14:45 ` [PATCH v3 1/8] serial: max3100: Enable TIOCM_LOOP Andy Shevchenko
2024-04-09 14:45 ` [PATCH v3 2/8] serial: max3100: Get crystal frequency via device property Andy Shevchenko
2024-04-09 14:45 ` [PATCH v3 3/8] serial: max3100: Remove duplicating irq field Andy Shevchenko
2024-04-09 14:45 ` [PATCH v3 4/8] serial: max3100: Switch to use dev_err_probe() Andy Shevchenko
2024-04-09 14:45 ` [PATCH v3 5/8] serial: max3100: Replace MODULE_ALIAS() with respective ID tables Andy Shevchenko
2024-04-09 14:45 ` Andy Shevchenko [this message]
2024-04-09 14:45 ` [PATCH v3 7/8] serial: max3100: Extract to_max3100_port() helper macro Andy Shevchenko
2024-04-10 7:17 ` Jiri Slaby
2024-04-10 13:55 ` Andy Shevchenko
2024-04-09 14:45 ` [PATCH v3 8/8] serial: max3100: Sort headers Andy Shevchenko
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=20240409144721.638326-7-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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