[PATCH] soc: mediatek: mtk-svs: Use %pe to print PTR_ERR()

From: Baran Tuna

Date: Tue Nov 24 2026 - 14:06:03 EST


Use the %pe format specifier to print error pointers symbolically
instead of printing PTR_ERR() as a number.

Found by scripts/coccinelle/misc/ptr_err_to_pe.cocci.

Signed-off-by: Baran Tuna <barant@xxxxxxxxxxxx>
---
Compile-tested only.

drivers/soc/mediatek/mtk-svs.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
index 0f37b3aadaa2..385c4aef9e91 100644
--- a/drivers/soc/mediatek/mtk-svs.c
+++ b/drivers/soc/mediatek/mtk-svs.c
@@ -594,8 +594,8 @@ static int svs_sync_bank_volts_from_opp(struct svs_bank *svsb)
svsb->opp_dfreq[i],
true);
if (IS_ERR(opp)) {
- dev_err(svsb->dev, "cannot find freq = %u (%ld)\n",
- svsb->opp_dfreq[i], PTR_ERR(opp));
+ dev_err(svsb->dev, "cannot find freq = %u (%pe)\n",
+ svsb->opp_dfreq[i], opp);
return PTR_ERR(opp);
}

@@ -833,9 +833,8 @@ static int svs_status_debug_show(struct seq_file *m, void *v)
opp = dev_pm_opp_find_freq_exact(svsb->opp_dev,
svsb->opp_dfreq[i], true);
if (IS_ERR(opp)) {
- seq_printf(m, "%s: cannot find freq = %u (%ld)\n",
- svsb->name, svsb->opp_dfreq[i],
- PTR_ERR(opp));
+ seq_printf(m, "%s: cannot find freq = %u (%pe)\n",
+ svsb->name, svsb->opp_dfreq[i], opp);
return PTR_ERR(opp);
}

@@ -1840,8 +1839,8 @@ static int svs_bank_resource_setup(struct svs_platform *svsp)
for (i = 0, freq = ULONG_MAX; i < bdata->opp_count; i++, freq--) {
opp = dev_pm_opp_find_freq_floor(svsb->opp_dev, &freq);
if (IS_ERR(opp)) {
- dev_err(svsb->dev, "cannot find freq = %ld\n",
- PTR_ERR(opp));
+ dev_err(svsb->dev, "cannot find freq = %pe\n",
+ opp);
return PTR_ERR(opp);
}

@@ -1864,8 +1863,8 @@ static int svs_get_efuse_data(struct svs_platform *svsp,

cell = nvmem_cell_get(svsp->dev, nvmem_cell_name);
if (IS_ERR(cell)) {
- dev_err(svsp->dev, "no \"%s\"? %ld\n",
- nvmem_cell_name, PTR_ERR(cell));
+ dev_err(svsp->dev, "no \"%s\"? %pe\n",
+ nvmem_cell_name, cell);
return PTR_ERR(cell);
}


base-commit: 8d7fe9885c62fc9a95bf55d9db244d9672a8aadc
--
2.53.0