]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: arm_scmi: Make use of tee bus methods
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Mon, 15 Dec 2025 14:16:41 +0000 (15:16 +0100)
committerJens Wiklander <jens.wiklander@linaro.org>
Wed, 7 Jan 2026 07:14:53 +0000 (08:14 +0100)
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.

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/firmware/arm_scmi/transports/optee.c

index 8fdb80d3fabd883ada7af24677a9f7d27a7b94ca..07ae18d5279d9efe9fc160bd7198ad581351befb 100644 (file)
@@ -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 @@ err:
        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,
        },
 };