From ec5c05e5ac8bcb4a6bcd92970e15494a85400d34 Mon Sep 17 00:00:00 2001 From: ye xingchen Date: Fri, 25 Nov 2022 15:44:36 +0800 Subject: [PATCH 1/3] hwspinlock: Use device_match_of_node() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the open-code with device_match_of_node(). Signed-off-by: ye xingchen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Baolin Wang Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/202211251544369078587@zte.com.cn --- drivers/hwspinlock/hwspinlock_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c index fd5f5c5a5244..22b8f2a70b3b 100644 --- a/drivers/hwspinlock/hwspinlock_core.c +++ b/drivers/hwspinlock/hwspinlock_core.c @@ -367,7 +367,7 @@ int of_hwspin_lock_get_id(struct device_node *np, int index) continue; } - if (hwlock->bank->dev->of_node == args.np) { + if (device_match_of_node(hwlock->bank->dev, args.np)) { ret = 0; break; } From 25d10262ed8aae71cd2f0b3c0a90d06a6b79fba2 Mon Sep 17 00:00:00 2001 From: Bastian Germann Date: Tue, 14 Feb 2023 00:19:28 +0100 Subject: [PATCH 2/3] dt-bindings: hwlock: sun6i: Add missing #hwlock-cells The allwinner,sun6i-a31-hwspinlock.yaml binding needs #hwlock-cells which is required by the hwlock type. Fixes: f9e784dcb63f ("dt-bindings: hwlock: add sun6i_hwspinlock") Signed-off-by: Bastian Germann Acked-by: Krzysztof Kozlowski Reviewed-by: Andre Przywara Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230213231931.6546-2-bage@debian.org --- .../bindings/hwlock/allwinner,sun6i-a31-hwspinlock.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/hwlock/allwinner,sun6i-a31-hwspinlock.yaml b/Documentation/devicetree/bindings/hwlock/allwinner,sun6i-a31-hwspinlock.yaml index 10e5a53e447b..01b1bbb3061f 100644 --- a/Documentation/devicetree/bindings/hwlock/allwinner,sun6i-a31-hwspinlock.yaml +++ b/Documentation/devicetree/bindings/hwlock/allwinner,sun6i-a31-hwspinlock.yaml @@ -26,11 +26,15 @@ properties: resets: maxItems: 1 + '#hwlock-cells': + const: 1 + required: - compatible - reg - clocks - resets + - "#hwlock-cells" additionalProperties: false From 95e158ec843666d76c09900507db08b76d77ce3e Mon Sep 17 00:00:00 2001 From: Bastian Germann Date: Wed, 15 Feb 2023 21:37:07 +0100 Subject: [PATCH 3/3] dt-bindings: hwlock: sun6i: Add #hwlock-cells to example The dt-bindings tools will compile the yaml dt examples and this prevents an error about this node not existing. Signed-off-by: Bastian Germann Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230215203711.6293-3-bage@debian.org --- .../bindings/hwlock/allwinner,sun6i-a31-hwspinlock.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/hwlock/allwinner,sun6i-a31-hwspinlock.yaml b/Documentation/devicetree/bindings/hwlock/allwinner,sun6i-a31-hwspinlock.yaml index 01b1bbb3061f..38478dad8b25 100644 --- a/Documentation/devicetree/bindings/hwlock/allwinner,sun6i-a31-hwspinlock.yaml +++ b/Documentation/devicetree/bindings/hwlock/allwinner,sun6i-a31-hwspinlock.yaml @@ -48,5 +48,6 @@ examples: reg = <0x01c18000 0x1000>; clocks = <&ccu CLK_BUS_SPINLOCK>; resets = <&ccu RST_BUS_SPINLOCK>; + #hwlock-cells = <1>; }; ...