From: Praveen Talari <praveen.talari@oss.qualcomm.com>
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Richard Genoud" <richard.genoud@bootlin.com>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Peter Griffin" <peter.griffin@linaro.org>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
"Orson Zhai" <orsonzhai@gmail.com>,
"Baolin Wang" <baolin.wang@linux.alibaba.com>,
"Chunyan Zhang" <zhang.lyra@gmail.com>,
"Patrice Chotard" <patrice.chotard@foss.st.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Peter Korsgaard" <jacmet@sunsite.dk>,
"Michal Simek" <michal.simek@amd.com>,
"Aaro Koskinen" <aaro.koskinen@iki.fi>,
"Janusz Krzysztofik" <jmkrzyszt@gmail.com>,
"Tony Lindgren" <tony@atomide.com>,
"Russell King" <linux@armlinux.org.uk>,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
bjorn.andersson@oss.qualcomm.com,
"Konrad Dybcio" <konrad.dybcio@oss.qualcomm.com>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
linux-arm-msm@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-omap@vger.kernel.org, linux-mips@vger.kernel.org,
Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>,
aniket.randive@oss.qualcomm.com,
chandana.chiluveru@oss.qualcomm.com,
Praveen Talari <praveen.talari@oss.qualcomm.com>
Subject: [PATCH 3/6] tty: serial: update .pm callbacks to return int
Date: Thu, 09 Jul 2026 11:55:15 +0530 [thread overview]
Message-ID: <20260709-add_return_check_for_uart_change_pm-v1-3-e85c6ffa8ec4@oss.qualcomm.com> (raw)
In-Reply-To: <20260709-add_return_check_for_uart_change_pm-v1-0-e85c6ffa8ec4@oss.qualcomm.com>
The uart_ops.pm callback signature has been changed from void to int.
Update all remaining non-8250 serial driver .pm implementations to match
the new signature by returning 0.
The sh-sci driver exports sci_pm() for reuse by rsci.c; update the
forward declaration in sh-sci-common.h accordingly.
Drivers updated:
atmel_serial: atmel_serial_pm()
dz: dz_pm()
fsl_lpuart: lpuart_uart_pm()
msm_serial: msm_power()
omap-serial: serial_omap_pm()
pxa: serial_pxa_pm()
qcom_geni_serial: qcom_geni_serial_pm()
samsung_tty: s3c24xx_serial_pm()
sc16is7xx: sc16is7xx_pm()
serial_txx9: serial_txx9_pm()
sh-sci/rsci: sci_pm()
sprd_serial: sprd_pm()
st-asc: asc_pm()
stm32-usart: stm32_usart_pm()
uartlite: ulite_pm()
xilinx_uartps: cdns_uart_pm()
zs: zs_pm()
No functional change intended.
Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
---
drivers/tty/serial/atmel_serial.c | 5 +++--
drivers/tty/serial/fsl_lpuart.c | 3 ++-
drivers/tty/serial/msm_serial.c | 5 +++--
drivers/tty/serial/omap-serial.c | 3 ++-
drivers/tty/serial/pxa.c | 3 ++-
drivers/tty/serial/qcom_geni_serial.c | 5 +++--
drivers/tty/serial/samsung_tty.c | 5 +++--
drivers/tty/serial/sc16is7xx.c | 5 +++--
drivers/tty/serial/serial_txx9.c | 3 ++-
drivers/tty/serial/sh-sci-common.h | 4 ++--
drivers/tty/serial/sh-sci.c | 5 +++--
drivers/tty/serial/sprd_serial.c | 5 +++--
drivers/tty/serial/st-asc.c | 5 +++--
drivers/tty/serial/stm32-usart.c | 5 +++--
drivers/tty/serial/uartlite.c | 5 +++--
drivers/tty/serial/xilinx_uartps.c | 5 +++--
16 files changed, 43 insertions(+), 28 deletions(-)
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 5d8c1cfc1c60..bcbcb77d4df8 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -2063,8 +2063,8 @@ static void atmel_shutdown(struct uart_port *port)
/*
* Power / Clock management.
*/
-static void atmel_serial_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate)
+static int atmel_serial_pm(struct uart_port *port, unsigned int state,
+ unsigned int oldstate)
{
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
@@ -2095,6 +2095,7 @@ static void atmel_serial_pm(struct uart_port *port, unsigned int state,
default:
dev_err(port->dev, "atmel_serial: unknown pm %d\n", state);
}
+ return 0;
}
/*
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index b7919c05f0fb..a6b6fb7aca88 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -820,7 +820,7 @@ static void lpuart32_start_tx(struct uart_port *port)
}
}
-static void
+static int
lpuart_uart_pm(struct uart_port *port, unsigned int state, unsigned int oldstate)
{
switch (state) {
@@ -832,6 +832,7 @@ lpuart_uart_pm(struct uart_port *port, unsigned int state, unsigned int oldstate
pm_runtime_get_sync(port->dev);
break;
}
+ return 0;
}
/* return TIOCSER_TEMT when transmitter is not busy */
diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index 2e999cb9c974..33b663a3514c 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -1421,8 +1421,8 @@ static int msm_verify_port(struct uart_port *port, struct serial_struct *ser)
return 0;
}
-static void msm_power(struct uart_port *port, unsigned int state,
- unsigned int oldstate)
+static int msm_power(struct uart_port *port, unsigned int state,
+ unsigned int oldstate)
{
struct msm_port *msm_port = to_msm_port(port);
@@ -1440,6 +1440,7 @@ static void msm_power(struct uart_port *port, unsigned int state,
default:
pr_err("msm_serial: Unknown PM state %d\n", state);
}
+ return 0;
}
#ifdef CONFIG_CONSOLE_POLL
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index a689d190940c..5029821e3559 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1017,7 +1017,7 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->port.line);
}
-static void
+static int
serial_omap_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate)
{
@@ -1035,6 +1035,7 @@ serial_omap_pm(struct uart_port *port, unsigned int state,
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
serial_out(up, UART_EFR, efr);
serial_out(up, UART_LCR, 0);
+ return 0;
}
static void serial_omap_release_port(struct uart_port *port)
diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 10fc8990579b..1f6541f251f9 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -507,7 +507,7 @@ serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios,
uart_port_unlock_irqrestore(&up->port, flags);
}
-static void
+static int
serial_pxa_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate)
{
@@ -517,6 +517,7 @@ serial_pxa_pm(struct uart_port *port, unsigned int state,
clk_prepare_enable(up->clk);
else
clk_disable_unprepare(up->clk);
+ return 0;
}
static void serial_pxa_release_port(struct uart_port *port)
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 7ead87b4eb65..17ab8acb3b8e 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1724,8 +1724,8 @@ static int geni_serial_resource_init(struct uart_port *uport)
return 0;
}
-static void qcom_geni_serial_pm(struct uart_port *uport,
- unsigned int new_state, unsigned int old_state)
+static int qcom_geni_serial_pm(struct uart_port *uport,
+ unsigned int new_state, unsigned int old_state)
{
/* If we've never been called, treat it as off */
@@ -1738,6 +1738,7 @@ static void qcom_geni_serial_pm(struct uart_port *uport,
old_state == UART_PM_STATE_ON)
pm_runtime_put_sync(uport->dev);
+ return 0;
}
/**
diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index 63d0232dffc2..4d35112cb153 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -1290,8 +1290,8 @@ static int apple_s5l_serial_startup(struct uart_port *port)
return ret;
}
-static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
- unsigned int old)
+static int s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
+ unsigned int old)
{
struct s3c24xx_uart_port *ourport = to_ourport(port);
int timeout = 10000;
@@ -1318,6 +1318,7 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
default:
dev_err(port->dev, "s3c24xx_serial: unknown pm %d\n", level);
}
+ return 0;
}
/* baud rate calculation
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index daebd92f32c7..47fec6c5e3c2 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1216,10 +1216,11 @@ static int sc16is7xx_verify_port(struct uart_port *port,
return 0;
}
-static void sc16is7xx_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate)
+static int sc16is7xx_pm(struct uart_port *port, unsigned int state,
+ unsigned int oldstate)
{
sc16is7xx_power(port, (state == UART_PM_STATE_ON) ? 1 : 0);
+ return 0;
}
static void sc16is7xx_null_void(struct uart_port *port)
diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c
index 4ae9a45c8e3a..e97dea43708a 100644
--- a/drivers/tty/serial/serial_txx9.c
+++ b/drivers/tty/serial/serial_txx9.c
@@ -680,7 +680,7 @@ serial_txx9_set_termios(struct uart_port *up, struct ktermios *termios,
uart_port_unlock_irqrestore(up, flags);
}
-static void
+static int
serial_txx9_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate)
{
@@ -694,6 +694,7 @@ serial_txx9_pm(struct uart_port *port, unsigned int state,
*/
if (state == 0 && oldstate != -1)
serial_txx9_initialize(port);
+ return 0;
}
static int serial_txx9_request_resource(struct uart_port *up)
diff --git a/drivers/tty/serial/sh-sci-common.h b/drivers/tty/serial/sh-sci-common.h
index 01ff9fced803..2f03750094df 100644
--- a/drivers/tty/serial/sh-sci-common.h
+++ b/drivers/tty/serial/sh-sci-common.h
@@ -44,8 +44,8 @@ void sci_release_port(struct uart_port *port);
int sci_request_port(struct uart_port *port);
void sci_config_port(struct uart_port *port, int flags);
int sci_verify_port(struct uart_port *port, struct serial_struct *ser);
-void sci_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate);
+int sci_pm(struct uart_port *port, unsigned int state,
+ unsigned int oldstate);
struct plat_sci_reg {
u8 offset;
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 787e7cdc5e9c..36a08fd6677f 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2931,8 +2931,8 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
sci_enable_ms(port);
}
-void sci_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate)
+int sci_pm(struct uart_port *port, unsigned int state,
+ unsigned int oldstate)
{
struct sci_port *sci_port = to_sci_port(port);
@@ -2944,6 +2944,7 @@ void sci_pm(struct uart_port *port, unsigned int state,
sci_port_enable(sci_port);
break;
}
+ return 0;
}
EXPORT_SYMBOL_NS_GPL(sci_pm, "SH_SCI");
diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index 092755f35683..571123f58232 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -900,8 +900,8 @@ static int sprd_verify_port(struct uart_port *port, struct serial_struct *ser)
return 0;
}
-static void sprd_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate)
+static int sprd_pm(struct uart_port *port, unsigned int state,
+ unsigned int oldstate)
{
struct sprd_uart_port *sup =
container_of(port, struct sprd_uart_port, port);
@@ -914,6 +914,7 @@ static void sprd_pm(struct uart_port *port, unsigned int state,
clk_disable_unprepare(sup->clk);
break;
}
+ return 0;
}
#ifdef CONFIG_CONSOLE_POLL
diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 6ed9a327702b..39404bd94592 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -435,8 +435,8 @@ static void asc_shutdown(struct uart_port *port)
free_irq(port->irq, port);
}
-static void asc_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate)
+static int asc_pm(struct uart_port *port, unsigned int state,
+ unsigned int oldstate)
{
struct asc_port *ascport = to_asc_port(port);
unsigned long flags;
@@ -459,6 +459,7 @@ static void asc_pm(struct uart_port *port, unsigned int state,
clk_disable_unprepare(ascport->clk);
break;
}
+ return 0;
}
static void asc_set_termios(struct uart_port *port, struct ktermios *termios,
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index ad06b760cfca..a4a93d3911f8 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -1418,8 +1418,8 @@ stm32_usart_verify_port(struct uart_port *port, struct serial_struct *ser)
return -EINVAL;
}
-static void stm32_usart_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate)
+static int stm32_usart_pm(struct uart_port *port, unsigned int state,
+ unsigned int oldstate)
{
struct stm32_port *stm32port = container_of(port,
struct stm32_port, port);
@@ -1438,6 +1438,7 @@ static void stm32_usart_pm(struct uart_port *port, unsigned int state,
pm_runtime_put_sync(port->dev);
break;
}
+ return 0;
}
#if defined(CONFIG_CONSOLE_POLL)
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index 6240c3d4dfd7..8e2d1d4dc10a 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -412,8 +412,8 @@ static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser)
return -EINVAL;
}
-static void ulite_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate)
+static int ulite_pm(struct uart_port *port, unsigned int state,
+ unsigned int oldstate)
{
int ret;
@@ -425,6 +425,7 @@ static void ulite_pm(struct uart_port *port, unsigned int state,
pm_runtime_mark_last_busy(port->dev);
pm_runtime_put_autosuspend(port->dev);
}
+ return 0;
}
#ifdef CONFIG_CONSOLE_POLL
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index a072b75dbaf2..c81a57e0c77e 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1231,8 +1231,8 @@ static void cdns_uart_poll_put_char(struct uart_port *port, unsigned char c)
}
#endif
-static void cdns_uart_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate)
+static int cdns_uart_pm(struct uart_port *port, unsigned int state,
+ unsigned int oldstate)
{
switch (state) {
case UART_PM_STATE_OFF:
@@ -1243,6 +1243,7 @@ static void cdns_uart_pm(struct uart_port *port, unsigned int state,
pm_runtime_get_sync(port->dev);
break;
}
+ return 0;
}
static const struct uart_ops cdns_uart_ops = {
--
2.34.1
next prev parent reply other threads:[~2026-07-09 6:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 6:25 [PATCH 0/6] tty: serial: propagate errors from uart_ops.pm callback Praveen Talari
2026-07-09 6:25 ` [PATCH 1/6] tty: serial: change uart_ops.pm callback to return int Praveen Talari
2026-07-09 6:25 ` [PATCH 2/6] serial: 8250: update .pm callbacks " Praveen Talari
2026-07-09 6:25 ` Praveen Talari [this message]
2026-07-09 6:25 ` [PATCH 4/6] arch: update uart pm " Praveen Talari
2026-07-09 6:25 ` [PATCH 5/6] tty: serial: propagate uart_configure_port failure to uart_add_one_port Praveen Talari
2026-07-09 6:25 ` [PATCH 6/6] serial: qcom-geni: check return value of pm_runtime_resume_and_get() Praveen Talari
2026-07-09 6:53 ` [PATCH 0/6] tty: serial: propagate errors from uart_ops.pm callback Jiri Slaby
2026-07-09 8:52 ` Praveen Talari
2026-07-09 10:16 ` Andy Shevchenko
2026-07-09 12:45 ` Praveen Talari
2026-07-09 7:31 ` Andy Shevchenko
2026-07-10 4:37 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260709-add_return_check_for_uart_change_pm-v1-3-e85c6ffa8ec4@oss.qualcomm.com \
--to=praveen.talari@oss.qualcomm.com \
--cc=aaro.koskinen@iki.fi \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=alim.akhtar@samsung.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=aniket.randive@oss.qualcomm.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=bjorn.andersson@oss.qualcomm.com \
--cc=chandana.chiluveru@oss.qualcomm.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jacmet@sunsite.dk \
--cc=jirislaby@kernel.org \
--cc=jmkrzyszt@gmail.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=michal.simek@amd.com \
--cc=mukesh.savaliya@oss.qualcomm.com \
--cc=nicolas.ferre@microchip.com \
--cc=orsonzhai@gmail.com \
--cc=patrice.chotard@foss.st.com \
--cc=peter.griffin@linaro.org \
--cc=richard.genoud@bootlin.com \
--cc=tony@atomide.com \
--cc=tsbogend@alpha.franken.de \
--cc=zhang.lyra@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox