Re: [PATCH v1 04/17] hwrng: optee - Make use of module_tee_client_driver()

Sumit Garg
2025-12-15T07:26:36Z

nit for subject: s/hwrng: optee -/hwrng: optee:/

On Thu, Dec 11, 2025 at 06:14:58PM +0100, Uwe Kleine-König wrote:
> Reduce boilerplate by using the newly introduced module_tee_client_driver().
> That takes care of assigning the driver's bus, so the explicit assigning
> in this driver can be dropped.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/char/hw_random/optee-rng.c | 14 +-------------
> 1 file changed, 1 insertion(+), 13 deletions(-)
>

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>

-Sumit

> diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c
> index 96b5d546d136..6ee748c0cf57 100644
> --- a/drivers/char/hw_random/optee-rng.c
> +++ b/drivers/char/hw_random/optee-rng.c
> @@ -281,24 +281,12 @@ static struct tee_client_driver optee_rng_driver = {
> .id_table = optee_rng_id_table,
> .driver = {
> .name = DRIVER_NAME,
> - .bus = &tee_bus_type,
> .probe = optee_rng_probe,
> .remove = optee_rng_remove,
> },
> };
>
> -static int __init optee_rng_mod_init(void)
> -{
> - return driver_register(&optee_rng_driver.driver);
> -}
> -
> -static void __exit optee_rng_mod_exit(void)
> -{
> - driver_unregister(&optee_rng_driver.driver);
> -}
> -
> -module_init(optee_rng_mod_init);
> -module_exit(optee_rng_mod_exit);
> +module_tee_client_driver(optee_rng_driver);
>
> MODULE_LICENSE("GPL v2");
> MODULE_AUTHOR("Sumit Garg <sumit.garg@linaro.org>");
> --
> 2.47.3
>
>