* [PATCH] greybus: Use bus methods for .probe() and .remove()
@ 2025-12-10 17:59 Uwe Kleine-König
2026-01-12 11:58 ` Uwe Kleine-König
2026-01-13 10:06 ` Johan Hovold
0 siblings, 2 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2025-12-10 17:59 UTC (permalink / raw)
To: Johan Hovold, Alex Elder, Greg Kroah-Hartman; +Cc: greybus-dev, linux-kernel
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@baylibre.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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] greybus: Use bus methods for .probe() and .remove()
2025-12-10 17:59 [PATCH] greybus: Use bus methods for .probe() and .remove() Uwe Kleine-König
@ 2026-01-12 11:58 ` Uwe Kleine-König
2026-01-12 12:06 ` Greg Kroah-Hartman
2026-01-13 10:06 ` Johan Hovold
1 sibling, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2026-01-12 11:58 UTC (permalink / raw)
To: Johan Hovold, Alex Elder, Greg Kroah-Hartman; +Cc: greybus-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 509 bytes --]
Hello,
On Wed, Dec 10, 2025 at 06:59:39PM +0100, Uwe Kleine-König wrote:
> 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@baylibre.com>
gentle ping. Who is supposed to pick this patch up (or criticize it)?
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] greybus: Use bus methods for .probe() and .remove()
2026-01-12 11:58 ` Uwe Kleine-König
@ 2026-01-12 12:06 ` Greg Kroah-Hartman
2026-01-12 12:27 ` Uwe Kleine-König
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2026-01-12 12:06 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Johan Hovold, Alex Elder, greybus-dev, linux-kernel
On Mon, Jan 12, 2026 at 12:58:02PM +0100, Uwe Kleine-König wrote:
> Hello,
>
> On Wed, Dec 10, 2025 at 06:59:39PM +0100, Uwe Kleine-König wrote:
> > 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@baylibre.com>
>
> gentle ping. Who is supposed to pick this patch up (or criticize it)?
That's me, my queue is huge, sorry...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] greybus: Use bus methods for .probe() and .remove()
2026-01-12 12:06 ` Greg Kroah-Hartman
@ 2026-01-12 12:27 ` Uwe Kleine-König
0 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2026-01-12 12:27 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Johan Hovold, Alex Elder, greybus-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 854 bytes --]
Hello Greg,
On Mon, Jan 12, 2026 at 01:06:31PM +0100, Greg Kroah-Hartman wrote:
> On Mon, Jan 12, 2026 at 12:58:02PM +0100, Uwe Kleine-König wrote:
> > Hello,
> >
> > On Wed, Dec 10, 2025 at 06:59:39PM +0100, Uwe Kleine-König wrote:
> > > 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@baylibre.com>
> >
> > gentle ping. Who is supposed to pick this patch up (or criticize it)?
>
> That's me, my queue is huge, sorry...
If it's still on someone's radar I can be patient. No (additional)
pressure from my side then.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] greybus: Use bus methods for .probe() and .remove()
2025-12-10 17:59 [PATCH] greybus: Use bus methods for .probe() and .remove() Uwe Kleine-König
2026-01-12 11:58 ` Uwe Kleine-König
@ 2026-01-13 10:06 ` Johan Hovold
1 sibling, 0 replies; 5+ messages in thread
From: Johan Hovold @ 2026-01-13 10:06 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Alex Elder, Greg Kroah-Hartman, greybus-dev, linux-kernel
On Wed, Dec 10, 2025 at 06:59:39PM +0100, Uwe Kleine-König wrote:
> 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@baylibre.com>
> -const struct bus_type greybus_bus_type = {
> - .name = "greybus",
> - .match = greybus_match_device,
> - .uevent = greybus_uevent,
> - .shutdown = greybus_shutdown,
> -};
> -
> +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,
> +};
> +
Please keep the indentation style when moving the struct.
With that addressed:
Acked-by: Johan Hovold <johan@kernel.org>
Johan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-01-13 10:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-10 17:59 [PATCH] greybus: Use bus methods for .probe() and .remove() Uwe Kleine-König
2026-01-12 11:58 ` Uwe Kleine-König
2026-01-12 12:06 ` Greg Kroah-Hartman
2026-01-12 12:27 ` Uwe Kleine-König
2026-01-13 10:06 ` Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®