[PATCH v1 1/6] firmware: arm_scmi: Remove const from transport descriptors

From: Cristian Marussi
Date: Tue Jul 30 2024 - 10:48:23 EST


The descriptor structure scmi_desc contains a variety of fields related to
the transport functionalities and it is defined by the transport drivers
themselves; such elements, though, serve varied purposes and have different
lifetime.

In particular, while there are some of those elements that provide a
description of transport features that are supposed to be immutable, on
the other side there are present also some other characteristics that are
instead supposed to be configurable on a per-platform base since they
represent configuration features tied to the specific hardware/firmware
system.

The immutable fields are already qualified as const on the their own; get
rid of the structure-level const qualifier which is not needed, so as to
enable possible runtime customization of the mutable configuration
features.

No functional change.

Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
---
drivers/firmware/arm_scmi/common.h | 2 +-
drivers/firmware/arm_scmi/scmi_transport_mailbox.c | 2 +-
drivers/firmware/arm_scmi/scmi_transport_optee.c | 2 +-
drivers/firmware/arm_scmi/scmi_transport_smc.c | 2 +-
drivers/firmware/arm_scmi/scmi_transport_virtio.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
index 77721cb4ac34..5261dc9b5f96 100644
--- a/drivers/firmware/arm_scmi/common.h
+++ b/drivers/firmware/arm_scmi/common.h
@@ -381,7 +381,7 @@ struct scmi_transport_core_operations {
*/
struct scmi_transport {
struct device *supplier;
- const struct scmi_desc *desc;
+ struct scmi_desc *desc;
struct scmi_transport_core_operations **core_ops;
};

diff --git a/drivers/firmware/arm_scmi/scmi_transport_mailbox.c b/drivers/firmware/arm_scmi/scmi_transport_mailbox.c
index 75483b6778ee..dc5ca894d5eb 100644
--- a/drivers/firmware/arm_scmi/scmi_transport_mailbox.c
+++ b/drivers/firmware/arm_scmi/scmi_transport_mailbox.c
@@ -355,7 +355,7 @@ static const struct scmi_transport_ops scmi_mailbox_ops = {
.poll_done = mailbox_poll_done,
};

-static const struct scmi_desc scmi_mailbox_desc = {
+static struct scmi_desc scmi_mailbox_desc = {
.ops = &scmi_mailbox_ops,
.max_rx_timeout_ms = 30, /* We may increase this if required */
.max_msg = 20, /* Limited by MBOX_TX_QUEUE_LEN */
diff --git a/drivers/firmware/arm_scmi/scmi_transport_optee.c b/drivers/firmware/arm_scmi/scmi_transport_optee.c
index 974128d73f2d..08911f40d1ff 100644
--- a/drivers/firmware/arm_scmi/scmi_transport_optee.c
+++ b/drivers/firmware/arm_scmi/scmi_transport_optee.c
@@ -510,7 +510,7 @@ static int scmi_optee_ctx_match(struct tee_ioctl_version_data *ver, const void *
return ver->impl_id == TEE_IMPL_ID_OPTEE;
}

-static const struct scmi_desc scmi_optee_desc = {
+static struct scmi_desc scmi_optee_desc = {
.ops = &scmi_optee_ops,
.max_rx_timeout_ms = 30,
.max_msg = 20,
diff --git a/drivers/firmware/arm_scmi/scmi_transport_smc.c b/drivers/firmware/arm_scmi/scmi_transport_smc.c
index 1c203a68acd4..c6c69a17a9cc 100644
--- a/drivers/firmware/arm_scmi/scmi_transport_smc.c
+++ b/drivers/firmware/arm_scmi/scmi_transport_smc.c
@@ -273,7 +273,7 @@ static const struct scmi_transport_ops scmi_smc_ops = {
.fetch_response = smc_fetch_response,
};

-static const struct scmi_desc scmi_smc_desc = {
+static struct scmi_desc scmi_smc_desc = {
.ops = &scmi_smc_ops,
.max_rx_timeout_ms = 30,
.max_msg = 20,
diff --git a/drivers/firmware/arm_scmi/scmi_transport_virtio.c b/drivers/firmware/arm_scmi/scmi_transport_virtio.c
index 55d7245fa7ee..d711ba6e07f6 100644
--- a/drivers/firmware/arm_scmi/scmi_transport_virtio.c
+++ b/drivers/firmware/arm_scmi/scmi_transport_virtio.c
@@ -790,7 +790,7 @@ static const struct scmi_transport_ops scmi_virtio_ops = {
.poll_done = virtio_poll_done,
};

-static const struct scmi_desc scmi_virtio_desc = {
+static struct scmi_desc scmi_virtio_desc = {
.ops = &scmi_virtio_ops,
/* for non-realtime virtio devices */
.max_rx_timeout_ms = VIRTIO_MAX_RX_TIMEOUT_MS,
--
2.45.2