From 6d8a0031d92d56f0cf57947df408d5cafd57bb22 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 15 Dec 2025 15:16:36 +0100 Subject: rtc: optee: Migrate to use tee specific driver registration function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tee subsystem recently got a set of dedicated functions to register (and unregister) a tee driver. Make use of them. These care for setting the driver's bus (so the explicit assignment can be dropped) and the driver owner (which is an improvement this driver benefits from). Reviewed-by: Sumit Garg Acked-by: Alexandre Belloni Signed-off-by: Uwe Kleine-König Signed-off-by: Jens Wiklander --- drivers/rtc/rtc-optee.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/rtc-optee.c b/drivers/rtc/rtc-optee.c index 184c6d142801..f924a729ead0 100644 --- a/drivers/rtc/rtc-optee.c +++ b/drivers/rtc/rtc-optee.c @@ -726,25 +726,13 @@ static struct tee_client_driver optee_rtc_driver = { .id_table = optee_rtc_id_table, .driver = { .name = "optee_rtc", - .bus = &tee_bus_type, .probe = optee_rtc_probe, .remove = optee_rtc_remove, .pm = pm_sleep_ptr(&optee_rtc_pm_ops), }, }; -static int __init optee_rtc_mod_init(void) -{ - return driver_register(&optee_rtc_driver.driver); -} - -static void __exit optee_rtc_mod_exit(void) -{ - driver_unregister(&optee_rtc_driver.driver); -} - -module_init(optee_rtc_mod_init); -module_exit(optee_rtc_mod_exit); +module_tee_client_driver(optee_rtc_driver); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Clément Léger "); -- cgit v1.2.3 From 4f32b6341818be62db1ea41ced68ca2f0cce5700 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 15 Dec 2025 15:16:37 +0100 Subject: rtc: optee: Make use of tee bus methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Reviewed-by: Sumit Garg Acked-by: Alexandre Belloni Signed-off-by: Uwe Kleine-König Signed-off-by: Jens Wiklander --- drivers/rtc/rtc-optee.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/rtc-optee.c b/drivers/rtc/rtc-optee.c index f924a729ead0..eefde789d194 100644 --- a/drivers/rtc/rtc-optee.c +++ b/drivers/rtc/rtc-optee.c @@ -547,9 +547,9 @@ static int optee_ctx_match(struct tee_ioctl_version_data *ver, const void *data) return 0; } -static int optee_rtc_probe(struct device *dev) +static int optee_rtc_probe(struct tee_client_device *rtc_device) { - struct tee_client_device *rtc_device = to_tee_client_device(dev); + struct device *dev = &rtc_device->dev; struct tee_ioctl_open_session_arg sess2_arg = {0}; struct tee_ioctl_open_session_arg sess_arg = {0}; struct optee_rtc *priv; @@ -682,8 +682,9 @@ out_ctx: return err; } -static int optee_rtc_remove(struct device *dev) +static void optee_rtc_remove(struct tee_client_device *rtc_device) { + struct device *dev = &rtc_device->dev; struct optee_rtc *priv = dev_get_drvdata(dev); if (priv->features & TA_RTC_FEATURE_ALARM) { @@ -696,8 +697,6 @@ static int optee_rtc_remove(struct device *dev) tee_shm_free(priv->shm); tee_client_close_session(priv->ctx, priv->session_id); tee_client_close_context(priv->ctx); - - return 0; } static int optee_rtc_suspend(struct device *dev) @@ -724,10 +723,10 @@ MODULE_DEVICE_TABLE(tee, optee_rtc_id_table); static struct tee_client_driver optee_rtc_driver = { .id_table = optee_rtc_id_table, + .probe = optee_rtc_probe, + .remove = optee_rtc_remove, .driver = { .name = "optee_rtc", - .probe = optee_rtc_probe, - .remove = optee_rtc_remove, .pm = pm_sleep_ptr(&optee_rtc_pm_ops), }, }; -- cgit v1.2.3