]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
greybus: Use bus methods for .probe() and .remove()
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Tue, 13 Jan 2026 14:50:09 +0000 (15:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Jan 2026 15:32:03 +0000 (16:32 +0100)
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.

Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20260113145012.2379944-2-u.kleine-koenig@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/greybus/core.c

index 313eb65cf70305abbe4870f89807f2e70309627d..45c5437c460faa0597b58029f16bf0d392f2ca15 100644 (file)
@@ -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;