[PATCH v1 11/17] firmware: arm_scmi: Make use of tee bus methods

Uwe Kleine-König
2025-12-11T17:16:07Z

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. Note that the return value of .remove()
was already ignored before, so there is no problem introduced by dropping
the error returns.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/firmware/arm_scmi/transports/optee.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/firmware/arm_scmi/transports/optee.c b/drivers/firmware/arm_scmi/transports/optee.c
index 8fdb80d3fabd..07ae18d5279d 100644
--- a/drivers/firmware/arm_scmi/transports/optee.c
+++ b/drivers/firmware/arm_scmi/transports/optee.c
@@ -529,8 +529,9 @@ static const struct of_device_id scmi_of_match[] = {
DEFINE_SCMI_TRANSPORT_DRIVER(scmi_optee, scmi_optee_driver, scmi_optee_desc,
scmi_of_match, core);

-static int scmi_optee_service_probe(struct device *dev)
+static int scmi_optee_service_probe(struct tee_client_device *scmi_pta)
{
+ struct device *dev = &scmi_pta->dev;
struct scmi_optee_agent *agent;
struct tee_context *tee_ctx;
int ret;
@@ -578,24 +579,22 @@ static int scmi_optee_service_probe(struct device *dev)
return ret;
}

-static int scmi_optee_service_remove(struct device *dev)
+static void scmi_optee_service_remove(struct tee_client_device *scmi_pta)
{
struct scmi_optee_agent *agent = scmi_optee_private;

if (!scmi_optee_private)
- return -EINVAL;
+ return;

platform_driver_unregister(&scmi_optee_driver);

if (!list_empty(&scmi_optee_private->channel_list))
- return -EBUSY;
+ return;

/* Ensure cleared reference is visible before resources are released */
smp_store_mb(scmi_optee_private, NULL);

tee_client_close_context(agent->tee_ctx);
-
- return 0;
}

static const struct tee_client_device_id scmi_optee_service_id[] = {
@@ -609,11 +608,11 @@ static const struct tee_client_device_id scmi_optee_service_id[] = {
MODULE_DEVICE_TABLE(tee, scmi_optee_service_id);

static struct tee_client_driver scmi_optee_service_driver = {
- .id_table = scmi_optee_service_id,
- .driver = {
+ .probe = scmi_optee_service_probe,
+ .remove = scmi_optee_service_remove,
+ .id_table = scmi_optee_service_id,
+ .driver = {
.name = "scmi-optee",
- .probe = scmi_optee_service_probe,
- .remove = scmi_optee_service_remove,
},
};

--
2.47.3