Skip to contentSkip to conversation

HID: pulsar: print the battery error with %pe

PATCH In review Aryan Sinha 2 participants 2 messages Nov 4 – Nov 5

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: pulsar: print the battery error with %pe

%pe prints the symbolic errno, which is easier to read than the raw number from the PTR_ERR().

---
 drivers/hid/hid-pulsar.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-pulsar.c +2 -2
index b0b34849f..ba7cc9f65 100644
@@ -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;
 	}
Signature · 1 line
2.46.0
maintainer
#1 lore raw

Hi Aryan,

thanks for the patch, the change itself looks good.
However, it only converts one of the error prints in the driver. The remaining ones still print the plain errno with %d. they can use %pe with ERR_PTR(ret) as well.
Could you send a v2 that converts all of them, so the driver reports errors consistently?

Thanks,
Nikolas