[PATCH v1 05/17] hwrng: optee - Make use of tee bus methods

Uwe Kleine-König
2025-12-12T10:59:54Z

The tee bus got dedicated callbacks for probe and remove.
Make use of these. This fixes a runtime warning about the driver needing
to be converted to the bus methods.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/char/hw_random/optee-rng.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c
index 6ee748c0cf57..5a3fa0b38497 100644
--- a/drivers/char/hw_random/optee-rng.c
+++ b/drivers/char/hw_random/optee-rng.c
@@ -211,9 +211,9 @@ static int optee_ctx_match(struct tee_ioctl_version_data *ver, const void *data)
return 0;
}

-static int optee_rng_probe(struct device *dev)
+static int optee_rng_probe(struct tee_client_device *rng_device)
{
- struct tee_client_device *rng_device = to_tee_client_device(dev);
+ struct device *dev = &rng_device->dev;
int ret = 0, err = -ENODEV;
struct tee_ioctl_open_session_arg sess_arg;

@@ -261,12 +261,10 @@ static int optee_rng_probe(struct device *dev)
return err;
}

-static int optee_rng_remove(struct device *dev)
+static void optee_rng_remove(struct tee_client_device *tee_dev)
{
tee_client_close_session(pvt_data.ctx, pvt_data.session_id);
tee_client_close_context(pvt_data.ctx);
-
- return 0;
}

static const struct tee_client_device_id optee_rng_id_table[] = {
@@ -278,11 +276,11 @@ static const struct tee_client_device_id optee_rng_id_table[] = {
MODULE_DEVICE_TABLE(tee, optee_rng_id_table);

static struct tee_client_driver optee_rng_driver = {
+ .probe = optee_rng_probe,
+ .remove = optee_rng_remove,
.id_table = optee_rng_id_table,
.driver = {
.name = DRIVER_NAME,
- .probe = optee_rng_probe,
- .remove = optee_rng_remove,
},
};

--
2.47.3