[PATCH 06/11] firmware: arm_scmi: add support for protocol modularization

Thara Gopinath thara.gopinath at linaro.org
Tue Oct 20 22:47:28 EDT 2020



On 10/14/20 11:05 AM, Cristian Marussi wrote:
> Modify protocol initialization callback adding a new parameter representing
> a reference to the available xfer core operations and introduce a macro to
> simply register with the core new protocols as loadable drivers.
> Keep standard protocols as builtin.
> 
> Signed-off-by: Cristian Marussi <cristian.marussi at arm.com>
> ---
>   drivers/firmware/arm_scmi/base.c    | 56 ++++++++++--------
>   drivers/firmware/arm_scmi/bus.c     | 14 ++++-
>   drivers/firmware/arm_scmi/clock.c   | 56 +++++++++---------
>   drivers/firmware/arm_scmi/common.h  | 42 +++++++++-----
>   drivers/firmware/arm_scmi/driver.c  | 50 ++++++++++------
>   drivers/firmware/arm_scmi/perf.c    | 88 +++++++++++++++--------------
>   drivers/firmware/arm_scmi/power.c   | 46 ++++++++-------
>   drivers/firmware/arm_scmi/reset.c   | 46 ++++++++-------
>   drivers/firmware/arm_scmi/sensors.c | 52 +++++++++--------
>   drivers/firmware/arm_scmi/system.c  | 16 ++++--
>   include/linux/scmi_protocol.h       | 18 +++++-
>   11 files changed, 288 insertions(+), 196 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/base.c b/drivers/firmware/arm_scmi/base.c
> index f40821eeb103..8d7214fd2187 100644
> --- a/drivers/firmware/arm_scmi/base.c
> +++ b/drivers/firmware/arm_scmi/base.c
> @@ -15,6 +15,8 @@
>   #define SCMI_BASE_NUM_SOURCES		1
>   #define SCMI_BASE_MAX_CMD_ERR_COUNT	1024
>   
> +static const struct scmi_xfer_ops *ops;

Minor nit. I would consider renaming ops to something more
meaningful like xfer_ops (or anything that makes sense). ops by
itself leads to confusion with ops in scmo_protocol and  in 
scmi_protocol_events.

Same suggestion for all other declarations of ops in this patch.

-- 
Warm Regards
Thara



More information about the linux-arm-kernel mailing list