Commit 35781630 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman

serdev: make use of printk extension %pe for better error messages

With %pe the symbolic name is printed, so you get

	failure adding device. status -EIO

which is more expressive than the current state

	failure adding device. status -5

.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20191212101649.18126-2-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 54edb425
...@@ -115,8 +115,8 @@ int serdev_device_add(struct serdev_device *serdev) ...@@ -115,8 +115,8 @@ int serdev_device_add(struct serdev_device *serdev)
err = device_add(&serdev->dev); err = device_add(&serdev->dev);
if (err < 0) { if (err < 0) {
dev_err(&serdev->dev, "Can't add %s, status %d\n", dev_err(&serdev->dev, "Can't add %s, status %pe\n",
dev_name(&serdev->dev), err); dev_name(&serdev->dev), ERR_PTR(err));
goto err_clear_serdev; goto err_clear_serdev;
} }
...@@ -540,7 +540,8 @@ static int of_serdev_register_devices(struct serdev_controller *ctrl) ...@@ -540,7 +540,8 @@ static int of_serdev_register_devices(struct serdev_controller *ctrl)
err = serdev_device_add(serdev); err = serdev_device_add(serdev);
if (err) { if (err) {
dev_err(&serdev->dev, dev_err(&serdev->dev,
"failure adding device. status %d\n", err); "failure adding device. status %pe\n",
ERR_PTR(err));
serdev_device_put(serdev); serdev_device_put(serdev);
} else } else
found = true; found = true;
...@@ -656,7 +657,8 @@ static acpi_status acpi_serdev_register_device(struct serdev_controller *ctrl, ...@@ -656,7 +657,8 @@ static acpi_status acpi_serdev_register_device(struct serdev_controller *ctrl,
err = serdev_device_add(serdev); err = serdev_device_add(serdev);
if (err) { if (err) {
dev_err(&serdev->dev, dev_err(&serdev->dev,
"failure adding ACPI serdev device. status %d\n", err); "failure adding ACPI serdev device. status %pe\n",
ERR_PTR(err));
serdev_device_put(serdev); serdev_device_put(serdev);
} }
...@@ -731,8 +733,8 @@ int serdev_controller_add(struct serdev_controller *ctrl) ...@@ -731,8 +733,8 @@ int serdev_controller_add(struct serdev_controller *ctrl)
ret_of = of_serdev_register_devices(ctrl); ret_of = of_serdev_register_devices(ctrl);
ret_acpi = acpi_serdev_register_devices(ctrl); ret_acpi = acpi_serdev_register_devices(ctrl);
if (ret_of && ret_acpi) { if (ret_of && ret_acpi) {
dev_dbg(&ctrl->dev, "no devices registered: of:%d acpi:%d\n", dev_dbg(&ctrl->dev, "no devices registered: of:%pe acpi:%pe\n",
ret_of, ret_acpi); ERR_PTR(ret_of), ERR_PTR(ret_acpi));
ret = -ENODEV; ret = -ENODEV;
goto err_rpm_disable; goto err_rpm_disable;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment