* [PATCH] staging: greybus: use %pe to print PTR_ERR in fw-core.c
[not found] <20260315-greybus-pe-format-v1-1-d923fbed3097.ref@yahoo.pl>
@ 2026-03-15 8:40 ` Tomasz Unger
2026-03-15 17:45 ` Ethan Tidmore
2026-03-16 8:44 ` Johan Hovold
0 siblings, 2 replies; 3+ messages in thread
From: Tomasz Unger @ 2026-03-15 8:40 UTC (permalink / raw)
To: Viresh Kumar, Johan Hovold, Alex Elder, Greg Kroah-Hartman
Cc: greybus-dev, linux-staging, linux-kernel, Tomasz Unger
Replace PTR_ERR() with %pe format specifier which directly prints
the error pointer in a human readable way, making the code cleaner
and more idiomatic.
Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
Verified with checkpatch.pl - no errors or warnings.
Compiled the gb-firmware module successfully.
Module compiles and loads in a QEMU environment.
---
drivers/staging/greybus/fw-core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/greybus/fw-core.c b/drivers/staging/greybus/fw-core.c
index 2016a74f137f..7053afa9ab3e 100644
--- a/drivers/staging/greybus/fw-core.c
+++ b/drivers/staging/greybus/fw-core.c
@@ -112,8 +112,8 @@ static int gb_fw_core_probe(struct gb_bundle *bundle,
connection = gb_connection_create(bundle, cport_id,
gb_fw_download_request_handler);
if (IS_ERR(connection)) {
- dev_err(&bundle->dev, "failed to create download connection (%ld)\n",
- PTR_ERR(connection));
+ dev_err(&bundle->dev, "failed to create download connection (%pe)\n",
+ connection);
} else {
fw_core->download_connection = connection;
}
@@ -131,8 +131,8 @@ static int gb_fw_core_probe(struct gb_bundle *bundle,
connection = gb_connection_create(bundle, cport_id,
NULL);
if (IS_ERR(connection)) {
- dev_err(&bundle->dev, "failed to create SPI connection (%ld)\n",
- PTR_ERR(connection));
+ dev_err(&bundle->dev, "failed to create SPI connection (%pe)\n",
+ connection);
} else {
fw_core->spi_connection = connection;
}
@@ -149,8 +149,8 @@ static int gb_fw_core_probe(struct gb_bundle *bundle,
connection = gb_connection_create(bundle, cport_id,
NULL);
if (IS_ERR(connection)) {
- dev_err(&bundle->dev, "failed to create Authentication connection (%ld)\n",
- PTR_ERR(connection));
+ dev_err(&bundle->dev, "failed to create Authentication connection (%pe)\n",
+ connection);
} else {
fw_core->cap_connection = connection;
}
---
base-commit: ad6bb64332bb4297110950769ad5af52791e33a2
change-id: 20260314-greybus-pe-format-85993705ee22
Best regards,
--
Tomasz Unger <tomasz.unger@yahoo.pl>
^ permalink raw reply [flat|nested] 3+ messages in thread