lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251210175943.590059-2-u.kleine-koenig@baylibre.com>
Date: Wed, 10 Dec 2025 18:59:39 +0100
From: Uwe Kleine-König <u.kleine-koenig@...libre.com>
To: Johan Hovold <johan@...nel.org>,
	Alex Elder <elder@...nel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: greybus-dev@...ts.linaro.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] greybus: Use bus methods for .probe() and .remove()

These are nearly identical to the respective driver callbacks. The only
difference is that .remove() returns void instead of int.

The objective is to get rid of users of struct device_driver callbacks
.probe() and .remove() to eventually remove these.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...libre.com>
---
 drivers/greybus/core.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/greybus/core.c b/drivers/greybus/core.c
index 313eb65cf703..927a69feb3fc 100644
--- a/drivers/greybus/core.c
+++ b/drivers/greybus/core.c
@@ -185,13 +185,6 @@ static void greybus_shutdown(struct device *dev)
 	}
 }
 
-const struct bus_type greybus_bus_type = {
-	.name =		"greybus",
-	.match =	greybus_match_device,
-	.uevent =	greybus_uevent,
-	.shutdown =	greybus_shutdown,
-};
-
 static int greybus_probe(struct device *dev)
 {
 	struct greybus_driver *driver = to_greybus_driver(dev->driver);
@@ -252,7 +245,7 @@ static int greybus_probe(struct device *dev)
 	return 0;
 }
 
-static int greybus_remove(struct device *dev)
+static void greybus_remove(struct device *dev)
 {
 	struct greybus_driver *driver = to_greybus_driver(dev->driver);
 	struct gb_bundle *bundle = to_gb_bundle(dev);
@@ -291,10 +284,17 @@ static int greybus_remove(struct device *dev)
 	pm_runtime_set_suspended(dev);
 	pm_runtime_dont_use_autosuspend(dev);
 	pm_runtime_put_noidle(dev);
-
-	return 0;
 }
 
+const struct bus_type greybus_bus_type = {
+	.name = "greybus",
+	.match = greybus_match_device,
+	.uevent = greybus_uevent,
+	.probe = greybus_probe,
+	.remove = greybus_remove,
+	.shutdown = greybus_shutdown,
+};
+
 int greybus_register_driver(struct greybus_driver *driver, struct module *owner,
 			    const char *mod_name)
 {
@@ -305,8 +305,6 @@ int greybus_register_driver(struct greybus_driver *driver, struct module *owner,
 
 	driver->driver.bus = &greybus_bus_type;
 	driver->driver.name = driver->name;
-	driver->driver.probe = greybus_probe;
-	driver->driver.remove = greybus_remove;
 	driver->driver.owner = owner;
 	driver->driver.mod_name = mod_name;
 

base-commit: 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
-- 
2.47.3


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ