Skip to contentSkip to conversation

SPMI patches for the next merge window

PATCH New Stephen Boyd 1 participant 4 messages Nov 9, 2024

Subsystems (5)
lore
Share & tools
lore

Stephen Boyd

author maintainer
#0 lore raw

cover SPMI patches for the next merge window

Hi Greg,

Please apply these SPMI patches for the next merge window.

- Compatible string updates for SPMI bindings
- Use scoped version of for_each_available_child_of_node() to avoid leaks

Dmitry Baryshkov (1):
dt-bindings: spmi: qcom,x1e80100-spmi-pmic-arb: Add SAR2130P
compatible

Fei Shao (1):
dt-bindings: spmi: spmi-mtk-pmif: Add compatible for MT8188

Javier Carrasco (1):
spmi: pmic-arb: fix return path in for_each_available_child_of_node()

 .../devicetree/bindings/spmi/mtk,spmi-mtk-pmif.yaml         | 1 +
 .../bindings/spmi/qcom,x1e80100-spmi-pmic-arb.yaml          | 6 +++++-
 drivers/spmi/spmi-pmic-arb.c                                | 3 +--
 3 files changed, 7 insertions(+), 3 deletions(-)

base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc

Signature · 2 lines
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git
author maintainer
#1 lore raw

PATCH 1/3 spmi: pmic-arb: fix return path in for_each_available_child_of_node()

From: Javier Carrasco <[email protected]>

This loop requires explicit calls to of_node_put() upon early exits (break, goto, return) to decrement the child refcounter and avoid memory leaks if the child is not required out of the loop.

A more robust solution is using the scoped variant of the macro, which automatically calls of_node_put() when the child goes out of scope.

---
 drivers/spmi/spmi-pmic-arb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/spmi/spmi-pmic-arb.c +1 -2
index 9ba9495fcc4b..ea843159b745 100644
@@ -1763,14 +1763,13 @@ static int spmi_pmic_arb_register_buses(struct spmi_pmic_arb *pmic_arb,
 {
 	struct device *dev = &pdev->dev;
 	struct device_node *node = dev->of_node;
-	struct device_node *child;
 	int ret;
 
 	/* legacy mode doesn't provide child node for the bus */
 	if (of_device_is_compatible(node, "qcom,spmi-pmic-arb"))
 		return spmi_pmic_arb_bus_init(pdev, node, pmic_arb);
 
-	for_each_available_child_of_node(node, child) {
+	for_each_available_child_of_node_scoped(node, child) {
 		if (of_node_name_eq(child, "spmi")) {
 			ret = spmi_pmic_arb_bus_init(pdev, child, pmic_arb);
 			if (ret)
Signature · 2 lines
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git
author maintainer
#2 lore raw

PATCH 2/3 dt-bindings: spmi: spmi-mtk-pmif: Add compatible for MT8188

In reply to Stephen Boyd

From: Fei Shao <[email protected]>

Add compatible string for the SPMI block on MT8188 SoC, which is compatible with the one used on MT8195.

---
 Documentation/devicetree/bindings/spmi/mtk,spmi-mtk-pmif.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/spmi/mtk,spmi-mtk-pmif.yaml +1 -0
index ac99883a3f29..7f0be0ac644a 100644
@@ -25,6 +25,7 @@ properties:
       - items:
           - enum:
               - mediatek,mt8186-spmi
+              - mediatek,mt8188-spmi
           - const: mediatek,mt8195-spmi
 
   reg:
Signature · 2 lines
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git
author maintainer
#3 lore raw

PATCH 3/3 dt-bindings: spmi: qcom,x1e80100-spmi-pmic-arb: Add SAR2130P compatible

In reply to Stephen Boyd

From: Dmitry Baryshkov <[email protected]>

SAR2130P has SPMI v7 arbiter. Although it has only a single bus configuration, use the new bindings for v7 platforms.

---
 .../bindings/spmi/qcom,x1e80100-spmi-pmic-arb.yaml          | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/spmi/qcom,x1e80100-spmi-pmic-arb.yaml +5 -1
index a28b70fb330a..7c3cc20a80d6 100644
@@ -19,7 +19,11 @@ description: |
 
 properties:
   compatible:
-    const: qcom,x1e80100-spmi-pmic-arb
+    oneOf:
+      - items:
+          - const: qcom,sar2130p-spmi-pmic-arb
+          - const: qcom,x1e80100-spmi-pmic-arb
+      - const: qcom,x1e80100-spmi-pmic-arb
 
   reg:
     items:
Signature · 2 lines
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git