Skip to content

Commit d6b4995

Browse files
galaknashif
authored andcommitted
riscv: rv32m1: Rework device_get_binding for pinmux
Switch to use DEVICE_DT_GET instead of device_get_binding for pinmux device. As part of this change drop the "label" property from the pinmux devicetree node and update the binding and dts files to reflect that. Signed-off-by: Kumar Gala <[email protected]>
1 parent 283f25f commit d6b4995

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

boards/riscv/rv32m1_vega/pinmux.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,28 @@ static int rv32m1_vega_pinmux_init(const struct device *dev)
2121

2222
#if DT_NODE_HAS_STATUS(DT_NODELABEL(porta), okay)
2323
__unused const struct device *porta =
24-
device_get_binding(DT_LABEL(DT_NODELABEL(porta)));
24+
DEVICE_DT_GET(DT_NODELABEL(porta));
25+
__ASSERT_NO_MSG(device_is_ready(porta));
2526
#endif
2627
#if DT_NODE_HAS_STATUS(DT_NODELABEL(portb), okay)
2728
__unused const struct device *portb =
28-
device_get_binding(DT_LABEL(DT_NODELABEL(portb)));
29+
DEVICE_DT_GET(DT_NODELABEL(portb));
30+
__ASSERT_NO_MSG(device_is_ready(portb));
2931
#endif
3032
#if DT_NODE_HAS_STATUS(DT_NODELABEL(portc), okay)
3133
__unused const struct device *portc =
32-
device_get_binding(DT_LABEL(DT_NODELABEL(portc)));
34+
DEVICE_DT_GET(DT_NODELABEL(portc));
35+
__ASSERT_NO_MSG(device_is_ready(portc));
3336
#endif
3437
#if DT_NODE_HAS_STATUS(DT_NODELABEL(portd), okay)
3538
__unused const struct device *portd =
36-
device_get_binding(DT_LABEL(DT_NODELABEL(portd)));
39+
DEVICE_DT_GET(DT_NODELABEL(portd));
40+
__ASSERT_NO_MSG(device_is_ready(portd));
3741
#endif
3842
#if DT_NODE_HAS_STATUS(DT_NODELABEL(porte), okay)
3943
__unused const struct device *porte =
40-
device_get_binding(DT_LABEL(DT_NODELABEL(porte)));
44+
DEVICE_DT_GET(DT_NODELABEL(porte));
45+
__ASSERT_NO_MSG(device_is_ready(porte));
4146
#endif
4247

4348
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpuart0), okay) && CONFIG_SERIAL

dts/bindings/pinctrl/openisa,rv32m1-pinmux.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ compatible: "openisa,rv32m1-pinmux"
55
include: base.yaml
66

77
properties:
8-
label:
9-
required: true
10-
118
reg:
129
required: true
1310

dts/riscv/rv32m1.dtsi

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,35 +282,30 @@
282282
compatible = "openisa,rv32m1-pinmux";
283283
reg = <0x40046000 0xd0>;
284284
clocks = <&pcc0 0x118>;
285-
label = "porta";
286285
};
287286

288287
portb: pinmux@40047000 {
289288
compatible = "openisa,rv32m1-pinmux";
290289
reg = <0x40047000 0xd0>;
291290
clocks = <&pcc0 0x11c>;
292-
label = "portb";
293291
};
294292

295293
portc: pinmux@40048000 {
296294
compatible = "openisa,rv32m1-pinmux";
297295
reg = <0x40048000 0xd0>;
298296
clocks = <&pcc0 0x120>;
299-
label = "portc";
300297
};
301298

302299
portd: pinmux@40049000 {
303300
compatible = "openisa,rv32m1-pinmux";
304301
reg = <0x40049000 0xd0>;
305302
clocks = <&pcc0 0x124>;
306-
label = "portd";
307303
};
308304

309305
porte: pinmux@41037000 {
310306
compatible = "openisa,rv32m1-pinmux";
311307
reg = <0x41037000 0xd0>;
312308
clocks = <&pcc1 0xdc>;
313-
label = "porte";
314309
};
315310

316311
gpioa: gpio@48020000 {

0 commit comments

Comments
 (0)