Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 398cecc24846 ("serial: 8250: omap: Fix imprecise external abort for omap_8250_pm()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20230517202012.634386-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Arnd Bergmann and committed by
Greg Kroah-Hartman
ae62c49c c53aab20

+5 -12
+5 -12
drivers/tty/serial/8250/8250_omap.c
··· 1595 1595 return 0; 1596 1596 } 1597 1597 1598 - #ifdef CONFIG_PM_SLEEP 1599 1598 static int omap8250_prepare(struct device *dev) 1600 1599 { 1601 1600 struct omap8250_priv *priv = dev_get_drvdata(dev); ··· 1639 1640 serial8250_resume_port(priv->line); 1640 1641 return 0; 1641 1642 } 1642 - #else 1643 - #define omap8250_prepare NULL 1644 - #define omap8250_complete NULL 1645 - #endif 1646 1643 1647 - #ifdef CONFIG_PM 1648 1644 static int omap8250_lost_context(struct uart_8250_port *up) 1649 1645 { 1650 1646 u32 val; ··· 1767 1773 schedule_work(&priv->qos_work); 1768 1774 return 0; 1769 1775 } 1770 - #endif 1771 1776 1772 1777 #ifdef CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP 1773 1778 static int __init omap8250_console_fixup(void) ··· 1809 1816 #endif 1810 1817 1811 1818 static const struct dev_pm_ops omap8250_dev_pm_ops = { 1812 - SET_SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume) 1813 - SET_RUNTIME_PM_OPS(omap8250_runtime_suspend, 1819 + SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume) 1820 + RUNTIME_PM_OPS(omap8250_runtime_suspend, 1814 1821 omap8250_runtime_resume, NULL) 1815 - .prepare = omap8250_prepare, 1816 - .complete = omap8250_complete, 1822 + .prepare = pm_sleep_ptr(omap8250_prepare), 1823 + .complete = pm_sleep_ptr(omap8250_complete), 1817 1824 }; 1818 1825 1819 1826 static struct platform_driver omap8250_platform_driver = { 1820 1827 .driver = { 1821 1828 .name = "omap8250", 1822 - .pm = &omap8250_dev_pm_ops, 1829 + .pm = pm_ptr(&omap8250_dev_pm_ops), 1823 1830 .of_match_table = omap8250_dt_ids, 1824 1831 }, 1825 1832 .probe = omap8250_probe,