summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/max3100.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-04-09 17:45:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-09 18:04:52 +0300
commit1d01740efb6856cf02905a84bf04b70d223993c2 (patch)
tree100adc146c3b2e820dffde2e08420ab23839ccfc /drivers/tty/serial/max3100.c
parent8250b1c1fdf617e953511289b46c8a77d4d4457c (diff)
downloadlinux-1d01740efb6856cf02905a84bf04b70d223993c2.tar.xz
serial: max3100: Switch to DEFINE_SIMPLE_DEV_PM_OPS()
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> Link: https://lore.kernel.org/r/20240409144721.638326-7-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/max3100.c')
-rw-r--r--drivers/tty/serial/max3100.c12
1 files 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,