HID: pulsar: print the battery error with %pe
Subsystems (2)
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().
Signed-off-by Aryan Sinha <[email protected]>
--- drivers/hid/hid-pulsar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-pulsar.c +2 -2
@@ -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
Nikolas Koesling
maintainerHi 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