diff options
author | Cristian Marussi <cristian.marussi@arm.com> | 2021-03-16 12:48:56 +0000 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2021-03-30 16:35:15 +0100 |
commit | f0e73cee26dd3edd0158dba33956f63596273ab9 (patch) | |
tree | 47b3ea7d6d914518de2fa6904695d341c827de11 /drivers/firmware/arm_scmi | |
parent | c3ed5e953ef0cdd599e70558e2b26696f1fbe77d (diff) |
firmware: arm_scmi: Make references to handle const
Now that all the protocol private variable data have been moved out of
struct scmi_handle, mark all of its references as const.
Link: https://lore.kernel.org/r/20210316124903.35011-32-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware/arm_scmi')
-rw-r--r-- | drivers/firmware/arm_scmi/common.h | 4 | ||||
-rw-r--r-- | drivers/firmware/arm_scmi/driver.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index 1bd332b5daa7..988f806bcf74 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -276,8 +276,8 @@ void __exit scmi_##name##_unregister(void) \ const struct scmi_protocol *scmi_protocol_get(int protocol_id); -int scmi_protocol_acquire(struct scmi_handle *handle, u8 protocol_id); -void scmi_protocol_release(struct scmi_handle *handle, u8 protocol_id); +int scmi_protocol_acquire(const struct scmi_handle *handle, u8 protocol_id); +void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id); /* SCMI Transport */ /** diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 23d26e8f2684..eb1276d8026e 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -739,7 +739,7 @@ scmi_alloc_init_protocol_instance(struct scmi_info *info, int ret = -ENOMEM; void *gid; struct scmi_protocol_instance *pi; - struct scmi_handle *handle = &info->handle; + const struct scmi_handle *handle = &info->handle; /* Protocol specific devres group */ gid = devres_open_group(handle->dev, NULL, GFP_KERNEL); @@ -805,7 +805,7 @@ out: * Return: A reference to an initialized protocol instance or error on failure. */ static struct scmi_protocol_instance * __must_check -scmi_get_protocol_instance(struct scmi_handle *handle, u8 protocol_id) +scmi_get_protocol_instance(const struct scmi_handle *handle, u8 protocol_id) { struct scmi_protocol_instance *pi; struct scmi_info *info = handle_to_scmi_info(handle); @@ -840,7 +840,7 @@ scmi_get_protocol_instance(struct scmi_handle *handle, u8 protocol_id) * * Return: 0 if protocol was acquired successfully. */ -int scmi_protocol_acquire(struct scmi_handle *handle, u8 protocol_id) +int scmi_protocol_acquire(const struct scmi_handle *handle, u8 protocol_id) { return PTR_ERR_OR_ZERO(scmi_get_protocol_instance(handle, protocol_id)); } @@ -853,7 +853,7 @@ int scmi_protocol_acquire(struct scmi_handle *handle, u8 protocol_id) * Remove one user for the specified protocol and triggers de-initialization * and resources de-allocation once the last user has gone. */ -void scmi_protocol_release(struct scmi_handle *handle, u8 protocol_id) +void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id) { struct scmi_info *info = handle_to_scmi_info(handle); struct scmi_protocol_instance *pi; @@ -908,7 +908,7 @@ scmi_is_protocol_implemented(const struct scmi_handle *handle, u8 prot_id) } struct scmi_protocol_devres { - struct scmi_handle *handle; + const struct scmi_handle *handle; u8 protocol_id; }; |