[PATCH] HID: pulsar: print the battery error with %pe
From: Aryan Sinha
Date: Wed Nov 04 2026 - 10:01:22 EST
%pe prints the symbolic errno, which is easier to read than the raw
number from the PTR_ERR().
Signed-off-by: Aryan Sinha <sinha.aryan03@xxxxxxxxx>
---
drivers/hid/hid-pulsar.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-pulsar.c b/drivers/hid/hid-pulsar.c
index b0b34849f..ba7cc9f65 100644
--- a/drivers/hid/hid-pulsar.c
+++ b/drivers/hid/hid-pulsar.c
@@ -615,8 +615,8 @@ static void pulsar_init_work(struct work_struct *work)
devm_power_supply_register(&hdev->dev, &drvdata->battery.desc,
&psy_cfg);
if (IS_ERR(drvdata->battery.ps)) {
- hid_err(hdev, "failed to register battery: %ld\n",
- PTR_ERR(drvdata->battery.ps));
+ hid_err(hdev, "failed to register battery: %pe\n",
+ drvdata->battery.ps);
drvdata->battery.ps = NULL;
return;
}
--
2.46.0