Skip to content

Commit 191ef0c

Browse files
ukleinekjenswi-linaro
authored andcommitted
firmware: arm_scmi: Make use of tee bus methods
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>
1 parent fe700bc commit 191ef0c

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

  • drivers/firmware/arm_scmi/transports

drivers/firmware/arm_scmi/transports/optee.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,9 @@ static const struct of_device_id scmi_of_match[] = {
529529
DEFINE_SCMI_TRANSPORT_DRIVER(scmi_optee, scmi_optee_driver, scmi_optee_desc,
530530
scmi_of_match, core);
531531

532-
static int scmi_optee_service_probe(struct device *dev)
532+
static int scmi_optee_service_probe(struct tee_client_device *scmi_pta)
533533
{
534+
struct device *dev = &scmi_pta->dev;
534535
struct scmi_optee_agent *agent;
535536
struct tee_context *tee_ctx;
536537
int ret;
@@ -578,24 +579,22 @@ static int scmi_optee_service_probe(struct device *dev)
578579
return ret;
579580
}
580581

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

585586
if (!scmi_optee_private)
586-
return -EINVAL;
587+
return;
587588

588589
platform_driver_unregister(&scmi_optee_driver);
589590

590591
if (!list_empty(&scmi_optee_private->channel_list))
591-
return -EBUSY;
592+
return;
592593

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

596597
tee_client_close_context(agent->tee_ctx);
597-
598-
return 0;
599598
}
600599

601600
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[] = {
609608
MODULE_DEVICE_TABLE(tee, scmi_optee_service_id);
610609

611610
static struct tee_client_driver scmi_optee_service_driver = {
612-
.id_table = scmi_optee_service_id,
613-
.driver = {
611+
.probe = scmi_optee_service_probe,
612+
.remove = scmi_optee_service_remove,
613+
.id_table = scmi_optee_service_id,
614+
.driver = {
614615
.name = "scmi-optee",
615-
.probe = scmi_optee_service_probe,
616-
.remove = scmi_optee_service_remove,
617616
},
618617
};
619618

0 commit comments

Comments
 (0)