Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: Log driver_register() failure
@ 2024-12-28 16:57 Steven Davis
  2024-12-29 10:19 ` gregkh
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Davis @ 2024-12-28 16:57 UTC (permalink / raw)
  To: johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org
  Cc: greybus-dev@lists.linaro.dev, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, Steven Davis

Currently, if driver_register() fails, it just returns retval
and fails silently. This behavior may make the error more difficult
to debug, as the error is not logged.

Adding pr_err() here will log the error descriptively, along with
driver name and the value that retval returned. That way, the error
is not silent and the user can see what happened.

Signed-off-by: Steven Davis <goldside000@outlook.com>
---
 drivers/staging/greybus/gbphy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/gbphy.c b/drivers/staging/greybus/gbphy.c
index 6adcad286..c6d1030b7 100644
--- a/drivers/staging/greybus/gbphy.c
+++ b/drivers/staging/greybus/gbphy.c
@@ -204,8 +204,10 @@ int gb_gbphy_register_driver(struct gbphy_driver *driver,
 	driver->driver.mod_name = mod_name;
 
 	retval = driver_register(&driver->driver);
-	if (retval)
+	if (retval) {
+		pr_err("failed to register driver %s: %d\n", driver->name, retval);
 		return retval;
+	}
 
 	pr_info("registered new driver %s\n", driver->name);
 	return 0;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-29 10:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-28 16:57 [PATCH] staging: greybus: Log driver_register() failure Steven Davis
2024-12-29 10:19 ` gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox