]> git.baikalelectronics.ru Git - kernel.git/commit
firmware: arm_scmi: Add devm_protocol_acquire helper
authorCristian Marussi <cristian.marussi@arm.com>
Mon, 4 Jul 2022 10:19:32 +0000 (11:19 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 4 Jul 2022 13:28:42 +0000 (14:28 +0100)
commit7d0154ebd063be71ee98422c8bfc0e4db5c59e3f
tree53efce23e9e834bdba12e6cf154c745f7b68e3d9
parent89a1215012e908d33d2e53d86c3bb63717a93207
firmware: arm_scmi: Add devm_protocol_acquire helper

Add a method to get hold of a protocol, causing it to be initialized and
its resource accounting updated, without getting access to its operations
and handle.

Some protocols, like SCMI SystemPower, do not expose any protocol ops to
the kernel OSPM agent but still need to be at least initialized. This
helper avoids the need to invoke a full devm_get_protocol() only to get
the protocol initialized while throwing away unused the protocol ops and
handle.

Link: https://lore.kernel.org/r/20220704101933.2981635-4-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/driver.c
include/linux/scmi_protocol.h