* [PATCH v2 1/1] serial: 8250_dw: Drop PM ifdeffery
@ 2022-06-30 9:33 Andy Shevchenko
2022-06-30 9:37 ` Ilpo Järvinen
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2022-06-30 9:33 UTC (permalink / raw)
To: Andy Shevchenko, Greg Kroah-Hartman, linux-serial, linux-kernel
Cc: Ilpo Järvinen, Jiri Slaby
Drop CONFIG_PM and CONFIG_PM_SLEEP ifdeffery while converting dw8250_pm_ops
to use new PM macros. Since we are using runtime PM, wrap dw8250_pm_ops into
pm_ptr().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: wrapped dw8250_pm_ops into pm_ptr() macro (Paul)
drivers/tty/serial/8250/8250_dw.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 921ac5c8cb38..927a4a85367a 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -743,7 +743,6 @@ static int dw8250_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
static int dw8250_suspend(struct device *dev)
{
struct dw8250_data *data = dev_get_drvdata(dev);
@@ -775,9 +774,7 @@ static int dw8250_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM_SLEEP */
-#ifdef CONFIG_PM
static int dw8250_runtime_suspend(struct device *dev)
{
struct dw8250_data *data = dev_get_drvdata(dev);
@@ -808,11 +805,10 @@ static int dw8250_runtime_resume(struct device *dev)
/* TODO: Check if it needs more than it's done in serial8250_console_restore() */
return 0;
}
-#endif
static const struct dev_pm_ops dw8250_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(dw8250_suspend, dw8250_resume)
- SET_RUNTIME_PM_OPS(dw8250_runtime_suspend, dw8250_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(dw8250_suspend, dw8250_resume)
+ RUNTIME_PM_OPS(dw8250_runtime_suspend, dw8250_runtime_resume, NULL)
};
static const struct dw8250_platform_data dw8250_dw_apb = {
@@ -870,7 +866,7 @@ MODULE_DEVICE_TABLE(acpi, dw8250_acpi_match);
static struct platform_driver dw8250_platform_driver = {
.driver = {
.name = "dw-apb-uart",
- .pm = &dw8250_pm_ops,
+ .pm = pm_ptr(&dw8250_pm_ops),
.of_match_table = dw8250_of_match,
.acpi_match_table = dw8250_acpi_match,
},
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2 1/1] serial: 8250_dw: Drop PM ifdeffery
2022-06-30 9:33 [PATCH v2 1/1] serial: 8250_dw: Drop PM ifdeffery Andy Shevchenko
@ 2022-06-30 9:37 ` Ilpo Järvinen
0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2022-06-30 9:37 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Greg Kroah-Hartman, linux-serial, LKML, Jiri Slaby
[-- Attachment #1: Type: text/plain, Size: 2141 bytes --]
On Thu, 30 Jun 2022, Andy Shevchenko wrote:
> Drop CONFIG_PM and CONFIG_PM_SLEEP ifdeffery while converting dw8250_pm_ops
> to use new PM macros. Since we are using runtime PM, wrap dw8250_pm_ops into
> pm_ptr().
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
> ---
> v2: wrapped dw8250_pm_ops into pm_ptr() macro (Paul)
> drivers/tty/serial/8250/8250_dw.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
> index 921ac5c8cb38..927a4a85367a 100644
> --- a/drivers/tty/serial/8250/8250_dw.c
> +++ b/drivers/tty/serial/8250/8250_dw.c
> @@ -743,7 +743,6 @@ static int dw8250_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM_SLEEP
> static int dw8250_suspend(struct device *dev)
> {
> struct dw8250_data *data = dev_get_drvdata(dev);
> @@ -775,9 +774,7 @@ static int dw8250_resume(struct device *dev)
>
> return 0;
> }
> -#endif /* CONFIG_PM_SLEEP */
>
> -#ifdef CONFIG_PM
> static int dw8250_runtime_suspend(struct device *dev)
> {
> struct dw8250_data *data = dev_get_drvdata(dev);
> @@ -808,11 +805,10 @@ static int dw8250_runtime_resume(struct device *dev)
> /* TODO: Check if it needs more than it's done in serial8250_console_restore() */
> return 0;
> }
> -#endif
>
> static const struct dev_pm_ops dw8250_pm_ops = {
> - SET_SYSTEM_SLEEP_PM_OPS(dw8250_suspend, dw8250_resume)
> - SET_RUNTIME_PM_OPS(dw8250_runtime_suspend, dw8250_runtime_resume, NULL)
> + SYSTEM_SLEEP_PM_OPS(dw8250_suspend, dw8250_resume)
> + RUNTIME_PM_OPS(dw8250_runtime_suspend, dw8250_runtime_resume, NULL)
> };
>
> static const struct dw8250_platform_data dw8250_dw_apb = {
> @@ -870,7 +866,7 @@ MODULE_DEVICE_TABLE(acpi, dw8250_acpi_match);
> static struct platform_driver dw8250_platform_driver = {
> .driver = {
> .name = "dw-apb-uart",
> - .pm = &dw8250_pm_ops,
> + .pm = pm_ptr(&dw8250_pm_ops),
> .of_match_table = dw8250_of_match,
> .acpi_match_table = dw8250_acpi_match,
> },
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-30 9:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-30 9:33 [PATCH v2 1/1] serial: 8250_dw: Drop PM ifdeffery Andy Shevchenko
2022-06-30 9:37 ` Ilpo Järvinen
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).