Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

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>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
986d388e b89921ee

+10 -12
+10 -12
drivers/greybus/core.c
··· 185 185 } 186 186 } 187 187 188 - const struct bus_type greybus_bus_type = { 189 - .name = "greybus", 190 - .match = greybus_match_device, 191 - .uevent = greybus_uevent, 192 - .shutdown = greybus_shutdown, 193 - }; 194 - 195 188 static int greybus_probe(struct device *dev) 196 189 { 197 190 struct greybus_driver *driver = to_greybus_driver(dev->driver); ··· 245 252 return 0; 246 253 } 247 254 248 - static int greybus_remove(struct device *dev) 255 + static void greybus_remove(struct device *dev) 249 256 { 250 257 struct greybus_driver *driver = to_greybus_driver(dev->driver); 251 258 struct gb_bundle *bundle = to_gb_bundle(dev); ··· 284 291 pm_runtime_set_suspended(dev); 285 292 pm_runtime_dont_use_autosuspend(dev); 286 293 pm_runtime_put_noidle(dev); 287 - 288 - return 0; 289 294 } 295 + 296 + const struct bus_type greybus_bus_type = { 297 + .name = "greybus", 298 + .match = greybus_match_device, 299 + .uevent = greybus_uevent, 300 + .probe = greybus_probe, 301 + .remove = greybus_remove, 302 + .shutdown = greybus_shutdown, 303 + }; 290 304 291 305 int greybus_register_driver(struct greybus_driver *driver, struct module *owner, 292 306 const char *mod_name) ··· 305 305 306 306 driver->driver.bus = &greybus_bus_type; 307 307 driver->driver.name = driver->name; 308 - driver->driver.probe = greybus_probe; 309 - driver->driver.remove = greybus_remove; 310 308 driver->driver.owner = owner; 311 309 driver->driver.mod_name = mod_name; 312 310