Skip to content

Commit ae62c49

Browse files
arndbgregkh
authored andcommitted
serial: 8250: omap: convert to modern PM ops
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: 398cecc ("serial: 8250: omap: Fix imprecise external abort for omap_8250_pm()") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Tony Lindgren <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c53aab2 commit ae62c49

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

drivers/tty/serial/8250/8250_omap.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,6 @@ static int omap8250_remove(struct platform_device *pdev)
15951595
return 0;
15961596
}
15971597

1598-
#ifdef CONFIG_PM_SLEEP
15991598
static int omap8250_prepare(struct device *dev)
16001599
{
16011600
struct omap8250_priv *priv = dev_get_drvdata(dev);
@@ -1640,12 +1639,7 @@ static int omap8250_resume(struct device *dev)
16401639
serial8250_resume_port(priv->line);
16411640
return 0;
16421641
}
1643-
#else
1644-
#define omap8250_prepare NULL
1645-
#define omap8250_complete NULL
1646-
#endif
16471642

1648-
#ifdef CONFIG_PM
16491643
static int omap8250_lost_context(struct uart_8250_port *up)
16501644
{
16511645
u32 val;
@@ -1773,7 +1767,6 @@ static int omap8250_runtime_resume(struct device *dev)
17731767
schedule_work(&priv->qos_work);
17741768
return 0;
17751769
}
1776-
#endif
17771770

17781771
#ifdef CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP
17791772
static int __init omap8250_console_fixup(void)
@@ -1816,17 +1809,17 @@ console_initcall(omap8250_console_fixup);
18161809
#endif
18171810

18181811
static const struct dev_pm_ops omap8250_dev_pm_ops = {
1819-
SET_SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume)
1820-
SET_RUNTIME_PM_OPS(omap8250_runtime_suspend,
1812+
SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume)
1813+
RUNTIME_PM_OPS(omap8250_runtime_suspend,
18211814
omap8250_runtime_resume, NULL)
1822-
.prepare = omap8250_prepare,
1823-
.complete = omap8250_complete,
1815+
.prepare = pm_sleep_ptr(omap8250_prepare),
1816+
.complete = pm_sleep_ptr(omap8250_complete),
18241817
};
18251818

18261819
static struct platform_driver omap8250_platform_driver = {
18271820
.driver = {
18281821
.name = "omap8250",
1829-
.pm = &omap8250_dev_pm_ops,
1822+
.pm = pm_ptr(&omap8250_dev_pm_ops),
18301823
.of_match_table = omap8250_dt_ids,
18311824
},
18321825
.probe = omap8250_probe,

0 commit comments

Comments
 (0)