* [PATCH] serial: 8250: omap: convert to modern PM ops
@ 2023-05-17 20:20 Arnd Bergmann
2023-05-19 5:44 ` Tony Lindgren
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2023-05-17 20:20 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Tony Lindgren
Cc: Arnd Bergmann, Ilpo Järvinen, Lukas Wunner, Andy Shevchenko,
Matthias Schiffer, linux-serial, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The new uart_write() function is only called from suspend/resume code, causing
a build warning when those are left out:
drivers/tty/serial/8250/8250_omap.c:169:13: error: 'uart_write' defined but not used [-Werror=unused-function]
Remove the #ifdefs and use the modern pm_ops/pm_sleep_ops and their wrappers
to let the compiler see where it's used but still drop the dead code.
Fixes: 398cecc24846 ("serial: 8250: omap: Fix imprecise external abort for omap_8250_pm()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/8250/8250_omap.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 5c093dfcee1d..00b2c35042ee 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1571,7 +1571,6 @@ static int omap8250_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
static int omap8250_prepare(struct device *dev)
{
struct omap8250_priv *priv = dev_get_drvdata(dev);
@@ -1616,12 +1615,7 @@ static int omap8250_resume(struct device *dev)
serial8250_resume_port(priv->line);
return 0;
}
-#else
-#define omap8250_prepare NULL
-#define omap8250_complete NULL
-#endif
-#ifdef CONFIG_PM
static int omap8250_lost_context(struct uart_8250_port *up)
{
u32 val;
@@ -1738,7 +1732,6 @@ static int omap8250_runtime_resume(struct device *dev)
schedule_work(&priv->qos_work);
return 0;
}
-#endif
#ifdef CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP
static int __init omap8250_console_fixup(void)
@@ -1781,17 +1774,17 @@ console_initcall(omap8250_console_fixup);
#endif
static const struct dev_pm_ops omap8250_dev_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume)
- SET_RUNTIME_PM_OPS(omap8250_runtime_suspend,
+ SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume)
+ RUNTIME_PM_OPS(omap8250_runtime_suspend,
omap8250_runtime_resume, NULL)
- .prepare = omap8250_prepare,
- .complete = omap8250_complete,
+ .prepare = pm_sleep_ptr(omap8250_prepare),
+ .complete = pm_sleep_ptr(omap8250_complete),
};
static struct platform_driver omap8250_platform_driver = {
.driver = {
.name = "omap8250",
- .pm = &omap8250_dev_pm_ops,
+ .pm = pm_ptr(&omap8250_dev_pm_ops),
.of_match_table = omap8250_dt_ids,
},
.probe = omap8250_probe,
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] serial: 8250: omap: convert to modern PM ops
2023-05-17 20:20 [PATCH] serial: 8250: omap: convert to modern PM ops Arnd Bergmann
@ 2023-05-19 5:44 ` Tony Lindgren
2023-05-30 11:20 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2023-05-19 5:44 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Greg Kroah-Hartman, Jiri Slaby, Arnd Bergmann, Ilpo Järvinen,
Lukas Wunner, Andy Shevchenko, Matthias Schiffer, linux-serial,
linux-kernel, Geert Uytterhoeven
* Arnd Bergmann <arnd@kernel.org> [230517 20:20]:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The new uart_write() function is only called from suspend/resume code, causing
> a build warning when those are left out:
>
> drivers/tty/serial/8250/8250_omap.c:169:13: error: 'uart_write' defined but not used [-Werror=unused-function]
>
> Remove the #ifdefs and use the modern pm_ops/pm_sleep_ops and their wrappers
> to let the compiler see where it's used but still drop the dead code.
This looks good to me as an alternative for Geert's fix. If Geert's
fix gets applied first, this needs to be rabased.
Reviewed-by: Tony Lindgren <tony@atomide.com>
> Fixes: 398cecc24846 ("serial: 8250: omap: Fix imprecise external abort for omap_8250_pm()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/tty/serial/8250/8250_omap.c | 17 +++++------------
> 1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
> index 5c093dfcee1d..00b2c35042ee 100644
> --- a/drivers/tty/serial/8250/8250_omap.c
> +++ b/drivers/tty/serial/8250/8250_omap.c
> @@ -1571,7 +1571,6 @@ static int omap8250_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM_SLEEP
> static int omap8250_prepare(struct device *dev)
> {
> struct omap8250_priv *priv = dev_get_drvdata(dev);
> @@ -1616,12 +1615,7 @@ static int omap8250_resume(struct device *dev)
> serial8250_resume_port(priv->line);
> return 0;
> }
> -#else
> -#define omap8250_prepare NULL
> -#define omap8250_complete NULL
> -#endif
>
> -#ifdef CONFIG_PM
> static int omap8250_lost_context(struct uart_8250_port *up)
> {
> u32 val;
> @@ -1738,7 +1732,6 @@ static int omap8250_runtime_resume(struct device *dev)
> schedule_work(&priv->qos_work);
> return 0;
> }
> -#endif
>
> #ifdef CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP
> static int __init omap8250_console_fixup(void)
> @@ -1781,17 +1774,17 @@ console_initcall(omap8250_console_fixup);
> #endif
>
> static const struct dev_pm_ops omap8250_dev_pm_ops = {
> - SET_SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume)
> - SET_RUNTIME_PM_OPS(omap8250_runtime_suspend,
> + SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume)
> + RUNTIME_PM_OPS(omap8250_runtime_suspend,
> omap8250_runtime_resume, NULL)
> - .prepare = omap8250_prepare,
> - .complete = omap8250_complete,
> + .prepare = pm_sleep_ptr(omap8250_prepare),
> + .complete = pm_sleep_ptr(omap8250_complete),
> };
>
> static struct platform_driver omap8250_platform_driver = {
> .driver = {
> .name = "omap8250",
> - .pm = &omap8250_dev_pm_ops,
> + .pm = pm_ptr(&omap8250_dev_pm_ops),
> .of_match_table = omap8250_dt_ids,
> },
> .probe = omap8250_probe,
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] serial: 8250: omap: convert to modern PM ops
2023-05-19 5:44 ` Tony Lindgren
@ 2023-05-30 11:20 ` Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2023-05-30 11:20 UTC (permalink / raw)
To: Tony Lindgren
Cc: Arnd Bergmann, Jiri Slaby, Arnd Bergmann, Ilpo Järvinen,
Lukas Wunner, Andy Shevchenko, Matthias Schiffer, linux-serial,
linux-kernel, Geert Uytterhoeven
On Fri, May 19, 2023 at 08:44:31AM +0300, Tony Lindgren wrote:
> * Arnd Bergmann <arnd@kernel.org> [230517 20:20]:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > The new uart_write() function is only called from suspend/resume code, causing
> > a build warning when those are left out:
> >
> > drivers/tty/serial/8250/8250_omap.c:169:13: error: 'uart_write' defined but not used [-Werror=unused-function]
> >
> > Remove the #ifdefs and use the modern pm_ops/pm_sleep_ops and their wrappers
> > to let the compiler see where it's used but still drop the dead code.
>
> This looks good to me as an alternative for Geert's fix. If Geert's
> fix gets applied first, this needs to be rabased.
No need for rebase, it applied cleanly.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-30 11:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-17 20:20 [PATCH] serial: 8250: omap: convert to modern PM ops Arnd Bergmann
2023-05-19 5:44 ` Tony Lindgren
2023-05-30 11:20 ` Greg Kroah-Hartman
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).