* [PATCH 0/2] host1x: Convert to bus methods
@ 2025-12-10 8:31 Uwe Kleine-König
2025-12-10 8:31 ` [PATCH 1/2] host1x: Make remove callback return void Uwe Kleine-König
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2025-12-10 8:31 UTC (permalink / raw)
To: Akhil R, Herbert Xu, David S. Miller, Thierry Reding,
Jonathan Hunter, Mikko Perttunen, David Airlie, Simona Vetter,
Sowjanya Komatineni, Luca Ceresoli, Mauro Carvalho Chehab,
Greg Kroah-Hartman
Cc: linux-crypto, linux-tegra, linux-kernel, dri-devel, linux-media,
linux-staging
Hello,
with the eventual goal to get rid of the callbacks .probe(), .remove()
and .shutdown() in struct device_driver, migrate host1x to use bus
callbacks instead.
Best regards
Uwe
Uwe Kleine-König (2):
host1x: Make remove callback return void
host1x: Convert to bus methods
drivers/crypto/tegra/tegra-se-main.c | 4 +-
drivers/gpu/drm/tegra/drm.c | 4 +-
drivers/gpu/host1x/bus.c | 67 +++++++++++------------
drivers/staging/media/tegra-video/video.c | 4 +-
include/linux/host1x.h | 2 +-
5 files changed, 37 insertions(+), 44 deletions(-)
base-commit: 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] host1x: Make remove callback return void
2025-12-10 8:31 [PATCH 0/2] host1x: Convert to bus methods Uwe Kleine-König
@ 2025-12-10 8:31 ` Uwe Kleine-König
2025-12-31 9:14 ` Luca Ceresoli
2025-12-10 8:31 ` [PATCH 2/2] host1x: Convert to bus methods Uwe Kleine-König
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Uwe Kleine-König @ 2025-12-10 8:31 UTC (permalink / raw)
To: Akhil R, Herbert Xu, David S. Miller, Thierry Reding,
Jonathan Hunter, Mikko Perttunen, David Airlie, Simona Vetter,
Sowjanya Komatineni, Luca Ceresoli, Mauro Carvalho Chehab,
Greg Kroah-Hartman
Cc: linux-crypto, linux-tegra, linux-kernel, dri-devel, linux-media,
linux-staging
The return value of struct device_driver::remove is ignored by the core
(see device_remove() in drivers/base/dd.c). So it doesn't make sense to
let the host1x remove callback return an int just to ignore it later.
So make the callback return void. All current implementors return 0, so
they are easily converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/crypto/tegra/tegra-se-main.c | 4 +---
drivers/gpu/drm/tegra/drm.c | 4 +---
drivers/gpu/host1x/bus.c | 2 +-
drivers/staging/media/tegra-video/video.c | 4 +---
include/linux/host1x.h | 2 +-
5 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/crypto/tegra/tegra-se-main.c b/drivers/crypto/tegra/tegra-se-main.c
index 7237f14eaf5a..4e7115b247e7 100644
--- a/drivers/crypto/tegra/tegra-se-main.c
+++ b/drivers/crypto/tegra/tegra-se-main.c
@@ -401,11 +401,9 @@ static int tegra_se_host1x_probe(struct host1x_device *dev)
return host1x_device_init(dev);
}
-static int tegra_se_host1x_remove(struct host1x_device *dev)
+static void tegra_se_host1x_remove(struct host1x_device *dev)
{
host1x_device_exit(dev);
-
- return 0;
}
static struct host1x_driver tegra_se_host1x_driver = {
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 4596073fe28f..bd0646eae555 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -1300,7 +1300,7 @@ static int host1x_drm_probe(struct host1x_device *dev)
return err;
}
-static int host1x_drm_remove(struct host1x_device *dev)
+static void host1x_drm_remove(struct host1x_device *dev)
{
struct drm_device *drm = dev_get_drvdata(&dev->dev);
struct tegra_drm *tegra = drm->dev_private;
@@ -1329,8 +1329,6 @@ static int host1x_drm_remove(struct host1x_device *dev)
kfree(tegra);
drm_dev_put(drm);
-
- return 0;
}
static void host1x_drm_shutdown(struct host1x_device *dev)
diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c
index 344cc9e741c1..fd89512d4488 100644
--- a/drivers/gpu/host1x/bus.c
+++ b/drivers/gpu/host1x/bus.c
@@ -628,7 +628,7 @@ static int host1x_device_remove(struct device *dev)
struct host1x_device *device = to_host1x_device(dev);
if (driver->remove)
- return driver->remove(device);
+ driver->remove(device);
return 0;
}
diff --git a/drivers/staging/media/tegra-video/video.c b/drivers/staging/media/tegra-video/video.c
index 074ad0dc56ca..68783d5ffeb1 100644
--- a/drivers/staging/media/tegra-video/video.c
+++ b/drivers/staging/media/tegra-video/video.c
@@ -107,7 +107,7 @@ static int host1x_video_probe(struct host1x_device *dev)
return ret;
}
-static int host1x_video_remove(struct host1x_device *dev)
+static void host1x_video_remove(struct host1x_device *dev)
{
struct tegra_video_device *vid = dev_get_drvdata(&dev->dev);
@@ -118,8 +118,6 @@ static int host1x_video_remove(struct host1x_device *dev)
/* This calls v4l2_dev release callback on last reference */
v4l2_device_put(&vid->v4l2_dev);
-
- return 0;
}
static const struct of_device_id host1x_video_subdevs[] = {
diff --git a/include/linux/host1x.h b/include/linux/host1x.h
index 9fa9c30a34e6..5e7a63143a4a 100644
--- a/include/linux/host1x.h
+++ b/include/linux/host1x.h
@@ -380,7 +380,7 @@ struct host1x_driver {
struct list_head list;
int (*probe)(struct host1x_device *device);
- int (*remove)(struct host1x_device *device);
+ void (*remove)(struct host1x_device *device);
void (*shutdown)(struct host1x_device *device);
};
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] host1x: Convert to bus methods
2025-12-10 8:31 [PATCH 0/2] host1x: Convert to bus methods Uwe Kleine-König
2025-12-10 8:31 ` [PATCH 1/2] host1x: Make remove callback return void Uwe Kleine-König
@ 2025-12-10 8:31 ` Uwe Kleine-König
2025-12-31 9:14 ` Luca Ceresoli
2026-01-12 11:53 ` [PATCH 0/2] " Uwe Kleine-König
2026-01-13 12:33 ` Thierry Reding
3 siblings, 1 reply; 7+ messages in thread
From: Uwe Kleine-König @ 2025-12-10 8:31 UTC (permalink / raw)
To: Akhil R, Herbert Xu, David S. Miller, Thierry Reding,
Jonathan Hunter, Mikko Perttunen, David Airlie, Simona Vetter,
Sowjanya Komatineni, Luca Ceresoli, Mauro Carvalho Chehab,
Greg Kroah-Hartman
Cc: linux-crypto, linux-tegra, linux-kernel, dri-devel, linux-media,
linux-staging
The callbacks .probe(), .remove() and .shutdown() for device_drivers
should go away. So migrate to bus methods. There are two differences
that need addressing:
- The bus remove callback returns void while the driver remove callback
returns int (the actual value is ignored by the core).
- The bus shutdown callback is also called for unbound devices, so an
additional check for dev->driver != NULL is needed.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/gpu/host1x/bus.c | 67 ++++++++++++++++++++--------------------
1 file changed, 33 insertions(+), 34 deletions(-)
diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c
index fd89512d4488..c0d7a9b5f07a 100644
--- a/drivers/gpu/host1x/bus.c
+++ b/drivers/gpu/host1x/bus.c
@@ -346,6 +346,36 @@ static int host1x_device_uevent(const struct device *dev,
return 0;
}
+static int host1x_device_probe(struct device *dev)
+{
+ struct host1x_driver *driver = to_host1x_driver(dev->driver);
+ struct host1x_device *device = to_host1x_device(dev);
+
+ if (driver->probe)
+ return driver->probe(device);
+
+ return 0;
+}
+
+static void host1x_device_remove(struct device *dev)
+{
+ struct host1x_driver *driver = to_host1x_driver(dev->driver);
+ struct host1x_device *device = to_host1x_device(dev);
+
+ if (driver->remove)
+ driver->remove(device);
+}
+
+static void host1x_device_shutdown(struct device *dev)
+{
+ struct host1x_driver *driver = to_host1x_driver(dev->driver);
+ struct host1x_device *device = to_host1x_device(dev);
+
+ if (dev->driver && driver->shutdown)
+ driver->shutdown(device);
+}
+
+
static const struct dev_pm_ops host1x_device_pm_ops = {
.suspend = pm_generic_suspend,
.resume = pm_generic_resume,
@@ -359,6 +389,9 @@ const struct bus_type host1x_bus_type = {
.name = "host1x",
.match = host1x_device_match,
.uevent = host1x_device_uevent,
+ .probe = host1x_device_probe,
+ .remove = host1x_device_remove,
+ .shutdown = host1x_device_shutdown,
.pm = &host1x_device_pm_ops,
};
@@ -611,37 +644,6 @@ int host1x_unregister(struct host1x *host1x)
return 0;
}
-static int host1x_device_probe(struct device *dev)
-{
- struct host1x_driver *driver = to_host1x_driver(dev->driver);
- struct host1x_device *device = to_host1x_device(dev);
-
- if (driver->probe)
- return driver->probe(device);
-
- return 0;
-}
-
-static int host1x_device_remove(struct device *dev)
-{
- struct host1x_driver *driver = to_host1x_driver(dev->driver);
- struct host1x_device *device = to_host1x_device(dev);
-
- if (driver->remove)
- driver->remove(device);
-
- return 0;
-}
-
-static void host1x_device_shutdown(struct device *dev)
-{
- struct host1x_driver *driver = to_host1x_driver(dev->driver);
- struct host1x_device *device = to_host1x_device(dev);
-
- if (driver->shutdown)
- driver->shutdown(device);
-}
-
/**
* host1x_driver_register_full() - register a host1x driver
* @driver: host1x driver
@@ -672,9 +674,6 @@ int host1x_driver_register_full(struct host1x_driver *driver,
driver->driver.bus = &host1x_bus_type;
driver->driver.owner = owner;
- driver->driver.probe = host1x_device_probe;
- driver->driver.remove = host1x_device_remove;
- driver->driver.shutdown = host1x_device_shutdown;
return driver_register(&driver->driver);
}
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] host1x: Make remove callback return void
2025-12-10 8:31 ` [PATCH 1/2] host1x: Make remove callback return void Uwe Kleine-König
@ 2025-12-31 9:14 ` Luca Ceresoli
0 siblings, 0 replies; 7+ messages in thread
From: Luca Ceresoli @ 2025-12-31 9:14 UTC (permalink / raw)
To: Uwe Kleine-König, Akhil R, Herbert Xu, David S. Miller,
Thierry Reding, Jonathan Hunter, Mikko Perttunen, David Airlie,
Simona Vetter, Sowjanya Komatineni, Mauro Carvalho Chehab,
Greg Kroah-Hartman
Cc: linux-crypto, linux-tegra, linux-kernel, dri-devel, linux-media,
linux-staging
Hello Uwe,
On Wed Dec 10, 2025 at 9:31 AM CET, Uwe Kleine-König wrote:
> The return value of struct device_driver::remove is ignored by the core
> (see device_remove() in drivers/base/dd.c). So it doesn't make sense to
> let the host1x remove callback return an int just to ignore it later.
>
> So make the callback return void. All current implementors return 0, so
> they are easily converted.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # tegra20 tegra-video
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] host1x: Convert to bus methods
2025-12-10 8:31 ` [PATCH 2/2] host1x: Convert to bus methods Uwe Kleine-König
@ 2025-12-31 9:14 ` Luca Ceresoli
0 siblings, 0 replies; 7+ messages in thread
From: Luca Ceresoli @ 2025-12-31 9:14 UTC (permalink / raw)
To: Uwe Kleine-König, Akhil R, Herbert Xu, David S. Miller,
Thierry Reding, Jonathan Hunter, Mikko Perttunen, David Airlie,
Simona Vetter, Sowjanya Komatineni, Mauro Carvalho Chehab,
Greg Kroah-Hartman
Cc: linux-crypto, linux-tegra, linux-kernel, dri-devel, linux-media,
linux-staging
On Wed Dec 10, 2025 at 9:31 AM CET, Uwe Kleine-König wrote:
> The callbacks .probe(), .remove() and .shutdown() for device_drivers
> should go away. So migrate to bus methods. There are two differences
> that need addressing:
>
> - The bus remove callback returns void while the driver remove callback
> returns int (the actual value is ignored by the core).
> - The bus shutdown callback is also called for unbound devices, so an
> additional check for dev->driver != NULL is needed.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # tegra20 tegra-video
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] host1x: Convert to bus methods
2025-12-10 8:31 [PATCH 0/2] host1x: Convert to bus methods Uwe Kleine-König
2025-12-10 8:31 ` [PATCH 1/2] host1x: Make remove callback return void Uwe Kleine-König
2025-12-10 8:31 ` [PATCH 2/2] host1x: Convert to bus methods Uwe Kleine-König
@ 2026-01-12 11:53 ` Uwe Kleine-König
2026-01-13 12:33 ` Thierry Reding
3 siblings, 0 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2026-01-12 11:53 UTC (permalink / raw)
To: Akhil R, Herbert Xu, David S. Miller, Thierry Reding,
Thierry Reding, Jonathan Hunter, Mikko Perttunen, David Airlie,
Simona Vetter, Sowjanya Komatineni, Luca Ceresoli,
Mauro Carvalho Chehab, Greg Kroah-Hartman
Cc: linux-crypto, linux-tegra, linux-kernel, dri-devel, linux-media,
linux-staging
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
Hello,
On Wed, Dec 10, 2025 at 09:31:36AM +0100, Uwe Kleine-König wrote:
> with the eventual goal to get rid of the callbacks .probe(), .remove()
> and .shutdown() in struct device_driver, migrate host1x to use bus
> callbacks instead.
This series got some positive feedback but nobody picked it up yet. Is
this still on someone's radar? The last patches to drivers/gpu/host1x
where picked up by Thierry.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] host1x: Convert to bus methods
2025-12-10 8:31 [PATCH 0/2] host1x: Convert to bus methods Uwe Kleine-König
` (2 preceding siblings ...)
2026-01-12 11:53 ` [PATCH 0/2] " Uwe Kleine-König
@ 2026-01-13 12:33 ` Thierry Reding
3 siblings, 0 replies; 7+ messages in thread
From: Thierry Reding @ 2026-01-13 12:33 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Akhil R, Herbert Xu, David S. Miller, Jonathan Hunter,
Mikko Perttunen, David Airlie, Simona Vetter, Sowjanya Komatineni,
Luca Ceresoli, Mauro Carvalho Chehab, Greg Kroah-Hartman,
linux-crypto, linux-tegra, linux-kernel, dri-devel, linux-media,
linux-staging
[-- Attachment #1: Type: text/plain, Size: 768 bytes --]
On Wed, Dec 10, 2025 at 09:31:36AM +0100, Uwe Kleine-König wrote:
> Hello,
>
> with the eventual goal to get rid of the callbacks .probe(), .remove()
> and .shutdown() in struct device_driver, migrate host1x to use bus
> callbacks instead.
>
> Best regards
> Uwe
>
> Uwe Kleine-König (2):
> host1x: Make remove callback return void
> host1x: Convert to bus methods
>
> drivers/crypto/tegra/tegra-se-main.c | 4 +-
> drivers/gpu/drm/tegra/drm.c | 4 +-
> drivers/gpu/host1x/bus.c | 67 +++++++++++------------
> drivers/staging/media/tegra-video/video.c | 4 +-
> include/linux/host1x.h | 2 +-
> 5 files changed, 37 insertions(+), 44 deletions(-)
Applied, thanks.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-01-13 12:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-10 8:31 [PATCH 0/2] host1x: Convert to bus methods Uwe Kleine-König
2025-12-10 8:31 ` [PATCH 1/2] host1x: Make remove callback return void Uwe Kleine-König
2025-12-31 9:14 ` Luca Ceresoli
2025-12-10 8:31 ` [PATCH 2/2] host1x: Convert to bus methods Uwe Kleine-König
2025-12-31 9:14 ` Luca Ceresoli
2026-01-12 11:53 ` [PATCH 0/2] " Uwe Kleine-König
2026-01-13 12:33 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox