[PATCH v4 0/4] firmware: qcom: scm: simplify code by using classes
From: Bartosz Golaszewski
Date: Mon Nov 02 2026 - 05:23:33 EST
There's a pattern of enabling the clocks and/or setting the bandwith
limits before performing an SCM call and reverting the above after it's
node. In all places it's done unconditionally and can be simplified by
providing appropriate classes. There are also a few places where we can
use __free() for tzmem pointers.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
---
Changes in v4:
- Rebased on top of v7.4-rc1, resolved conflicts with recent changes
- Link to v3: https://patch.msgid.link/20260903-qcom-scm-code-shrink-v3-0-8237f3a654e1@xxxxxxxxxxxxxxxx
Changes in v3:
- Change the naming for clk and bw guards to be more descriptive of
their function
- Link to v2: https://patch.msgid.link/20260731-qcom-scm-code-shrink-v2-0-4ba76096915f@xxxxxxxxxxxxxxxx
Changes in v2:
- Rabase on top of recent SCM driver changes which introduced conflicts
- Collect tags
- Link to v1: https://patch.msgid.link/20260701-qcom-scm-code-shrink-v1-0-02f5ce02c95a@xxxxxxxxxxxxxxxx
---
Bartosz Golaszewski (4):
firmware: qcom: tzmem: guard against IS_ERR() in the cleanup handler
firmware: qcom: scm: use __free(qcom_tzmem) to simplify cleanup
firmware: qcom: scm: introduce qcom_scm_clk class for clock management
firmware: qcom: scm: introduce qcom_scm_bw class for bandwidth management
drivers/firmware/qcom/qcom_scm.c | 193 ++++++++++++-------------------
include/linux/firmware/qcom/qcom_tzmem.h | 2 +-
2 files changed, 76 insertions(+), 119 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20260701-qcom-scm-code-shrink-c9aff845537d
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>