Skip to content

Commit bc9ba0b

Browse files
committed
Use device_{get,set}prop_bool().
1 parent 1e614e9 commit bc9ba0b

7 files changed

Lines changed: 28 additions & 46 deletions

File tree

sys/arch/arm/rockchip/rk_drm.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: rk_drm.c,v 1.21 2022/10/30 23:10:43 jmcneill Exp $ */
1+
/* $NetBSD: rk_drm.c,v 1.22 2025/10/13 14:12:13 thorpej Exp $ */
22

33
/*-
44
* Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca>
@@ -27,7 +27,7 @@
2727
*/
2828

2929
#include <sys/cdefs.h>
30-
__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.21 2022/10/30 23:10:43 jmcneill Exp $");
30+
__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.22 2025/10/13 14:12:13 thorpej Exp $");
3131

3232
#include <sys/param.h>
3333
#include <sys/bus.h>
@@ -120,22 +120,18 @@ rk_drm_attach(device_t parent, device_t self, void *aux)
120120
struct rk_drm_softc * const sc = device_private(self);
121121
struct fdt_attach_args * const faa = aux;
122122
struct drm_driver * const driver = &rk_drm_driver;
123-
prop_dictionary_t dict = device_properties(self);
124-
bool is_disabled;
125123

126124
aprint_naive("\n");
127125

128-
if (prop_dictionary_get_bool(dict, "disabled", &is_disabled) &&
129-
is_disabled) {
126+
if (device_getprop_bool(self, "disabled")) {
130127
aprint_normal(": (disabled)\n");
131128
return;
132129
}
133130

134131
aprint_normal("\n");
135132

136133
#ifdef WSDISPLAY_MULTICONS
137-
const bool is_console = true;
138-
prop_dictionary_set_bool(dict, "is_console", is_console);
134+
device_setprop_bool(self, "is_console", true);
139135
#endif
140136

141137
sc->sc_dev = self;

sys/arch/arm/sunxi/sun50i_a64_ccu.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: sun50i_a64_ccu.c,v 1.24 2021/11/07 17:13:26 jmcneill Exp $ */
1+
/* $NetBSD: sun50i_a64_ccu.c,v 1.25 2025/10/13 14:12:13 thorpej Exp $ */
22

33
/*-
44
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@@ -28,7 +28,7 @@
2828

2929
#include <sys/cdefs.h>
3030

31-
__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.24 2021/11/07 17:13:26 jmcneill Exp $");
31+
__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.25 2025/10/13 14:12:13 thorpej Exp $");
3232

3333
#include <sys/param.h>
3434
#include <sys/bus.h>
@@ -618,8 +618,6 @@ sun50i_a64_ccu_attach(device_t parent, device_t self, void *aux)
618618
{
619619
struct sunxi_ccu_softc * const sc = device_private(self);
620620
struct fdt_attach_args * const faa = aux;
621-
prop_dictionary_t prop = device_properties(self);
622-
bool nomodeset;
623621

624622
sc->sc_dev = self;
625623
sc->sc_phandle = faa->faa_phandle;
@@ -637,9 +635,7 @@ sun50i_a64_ccu_attach(device_t parent, device_t self, void *aux)
637635
aprint_naive("\n");
638636
aprint_normal(": A64 CCU\n");
639637

640-
nomodeset = false;
641-
prop_dictionary_get_bool(prop, "nomodeset", &nomodeset);
642-
if (!nomodeset) {
638+
if (! device_getprop_bool(self, "nomodeset")) {
643639
/* Set DE parent to PLL_DE */
644640
clk_set_parent(&sc->sc_clks[A64_CLK_DE].base, &sc->sc_clks[A64_CLK_PLL_DE].base);
645641
clk_set_rate(&sc->sc_clks[A64_CLK_PLL_DE].base, 420000000);

sys/arch/arm/sunxi/sunxi_drm.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: sunxi_drm.c,v 1.26 2022/09/25 07:50:23 riastradh Exp $ */
1+
/* $NetBSD: sunxi_drm.c,v 1.27 2025/10/13 14:12:13 thorpej Exp $ */
22

33
/*-
44
* Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca>
@@ -27,7 +27,7 @@
2727
*/
2828

2929
#include <sys/cdefs.h>
30-
__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.26 2022/09/25 07:50:23 riastradh Exp $");
30+
__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.27 2025/10/13 14:12:13 thorpej Exp $");
3131

3232
#include <sys/param.h>
3333
#include <sys/bus.h>
@@ -136,22 +136,18 @@ sunxi_drm_attach(device_t parent, device_t self, void *aux)
136136
struct sunxi_drm_softc * const sc = device_private(self);
137137
struct fdt_attach_args * const faa = aux;
138138
struct drm_driver * const driver = &sunxi_drm_driver;
139-
prop_dictionary_t dict = device_properties(self);
140-
bool is_disabled;
141139

142140
aprint_naive("\n");
143141

144-
if (prop_dictionary_get_bool(dict, "disabled", &is_disabled) &&
145-
is_disabled) {
142+
if (device_getprop_bool(self, "disabled")) {
146143
aprint_normal(": Display Engine Pipeline (disabled)\n");
147144
return;
148145
}
149146

150147
aprint_normal(": Display Engine Pipeline\n");
151148

152149
#ifdef WSDISPLAY_MULTICONS
153-
const bool is_console = true;
154-
prop_dictionary_set_bool(dict, "is_console", is_console);
150+
device_setprop_bool(self, "is_console", true);
155151
#endif
156152

157153
sc->sc_dev = self;

sys/arch/arm/sunxi/sunxi_dwhdmi.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: sunxi_dwhdmi.c,v 1.11 2021/12/19 11:01:10 riastradh Exp $ */
1+
/* $NetBSD: sunxi_dwhdmi.c,v 1.12 2025/10/13 14:12:13 thorpej Exp $ */
22

33
/*-
44
* Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca>
@@ -27,7 +27,7 @@
2727
*/
2828

2929
#include <sys/cdefs.h>
30-
__KERNEL_RCSID(0, "$NetBSD: sunxi_dwhdmi.c,v 1.11 2021/12/19 11:01:10 riastradh Exp $");
30+
__KERNEL_RCSID(0, "$NetBSD: sunxi_dwhdmi.c,v 1.12 2025/10/13 14:12:13 thorpej Exp $");
3131

3232
#include <sys/param.h>
3333
#include <sys/bus.h>
@@ -229,15 +229,13 @@ sunxi_dwhdmi_attach(device_t parent, device_t self, void *aux)
229229
{
230230
struct sunxi_dwhdmi_softc * const sc = device_private(self);
231231
struct fdt_attach_args * const faa = aux;
232-
prop_dictionary_t prop = device_properties(self);
233232
const int phandle = faa->faa_phandle;
234233
struct clk *clk_iahb, *clk_isfr, *clk_tmds;
235234
struct fdtbus_reset *rst;
236-
bool is_disabled;
237235
bus_addr_t addr;
238236
bus_size_t size;
239237

240-
if (prop_dictionary_get_bool(prop, "disabled", &is_disabled) && is_disabled) {
238+
if (device_getprop_bool(self, "disabled")) {
241239
aprint_naive("\n");
242240
aprint_normal(": HDMI TX (disabled)\n");
243241
return;

sys/arch/arm/ti/ti_lcdc.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: ti_lcdc.c,v 1.14 2022/09/25 07:50:32 riastradh Exp $ */
1+
/* $NetBSD: ti_lcdc.c,v 1.15 2025/10/13 14:12:13 thorpej Exp $ */
22

33
/*-
44
* Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca>
@@ -27,7 +27,7 @@
2727
*/
2828

2929
#include <sys/cdefs.h>
30-
__KERNEL_RCSID(0, "$NetBSD: ti_lcdc.c,v 1.14 2022/09/25 07:50:32 riastradh Exp $");
30+
__KERNEL_RCSID(0, "$NetBSD: ti_lcdc.c,v 1.15 2025/10/13 14:12:13 thorpej Exp $");
3131

3232
#include <sys/param.h>
3333
#include <sys/bus.h>
@@ -381,20 +381,17 @@ tilcdc_attach(device_t parent, device_t self, void *aux)
381381
struct fdt_attach_args * const faa = aux;
382382
const int phandle = faa->faa_phandle;
383383
struct drm_driver * const driver = &tilcdc_driver;
384-
prop_dictionary_t dict = device_properties(self);
385-
bool is_disabled;
386384
bus_addr_t addr;
387385
bus_size_t size;
388386
int error;
389387

390-
if (prop_dictionary_get_bool(dict, "disabled", &is_disabled) && is_disabled) {
388+
if (device_getprop_bool(self, "disabled")) {
391389
aprint_normal(": TI LCDC (disabled)\n");
392390
return;
393391
}
394392

395393
#ifdef WSDISPLAY_MULTICONS
396-
const bool is_console = true;
397-
prop_dictionary_set_bool(dict, "is_console", is_console);
394+
device_setprop_bool(self, "is_console", true);
398395
#endif
399396

400397
if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) {

sys/arch/ibmnws/ibmnws/autoconf.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: autoconf.c,v 1.12 2012/07/29 18:05:43 mlelstv Exp $ */
1+
/* $NetBSD: autoconf.c,v 1.13 2025/10/13 14:12:13 thorpej Exp $ */
22

33
/*-
44
* Copyright (c) 1990 The Regents of the University of California.
@@ -137,9 +137,8 @@ device_register(device_t dev, void *aux)
137137

138138
dict = device_properties(dev);
139139
if (BUILTIN_ETHERNET_P(pa)) {
140-
if (! prop_dictionary_set_bool(dict,
141-
"am79c970-no-eeprom",
142-
true)) {
140+
if (! device_setprop_bool(dev, "am79c970-no-eeprom",
141+
true)) {
143142
aprint_normal("WARNING: unable to set "
144143
"am79c970-no-eeprom property for %s\n",
145144
device_xname(dev));
@@ -167,9 +166,9 @@ device_register(device_t dev, void *aux)
167166
"address property for %s\n",
168167
device_xname(dev));
169168
}
170-
if (! prop_dictionary_set_bool(dict, "is_console", true)) {
169+
if (! device_setprop_bool(dev, "is_console", true)) {
171170
aprint_normal("WARNING: unable to set "
172-
"address property for %s\n",
171+
"is_console property for %s\n",
173172
device_xname(dev));
174173
}
175174

sys/arch/x86/x86/x86_autoconf.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: x86_autoconf.c,v 1.91 2025/04/30 05:15:08 imil Exp $ */
1+
/* $NetBSD: x86_autoconf.c,v 1.92 2025/10/13 14:12:13 thorpej Exp $ */
22

33
/*-
44
* Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
3535
*/
3636

3737
#include <sys/cdefs.h>
38-
__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.91 2025/04/30 05:15:08 imil Exp $");
38+
__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.92 2025/10/13 14:12:13 thorpej Exp $");
3939

4040
#include <sys/param.h>
4141
#include <sys/systm.h>
@@ -602,9 +602,9 @@ device_register(device_t dev, void *aux)
602602
(void)device_hyperv_register(dev, aux);
603603
#endif
604604

605-
if (device_is_a(dev, "com") && vm_guest > VM_GUEST_NO)
606-
prop_dictionary_set_bool(device_properties(dev),
607-
"skip_attach_delay", true);
605+
if (device_is_a(dev, "com") && vm_guest > VM_GUEST_NO) {
606+
device_setprop_bool(dev, "skip_attach_delay", true);
607+
}
608608

609609
if (isaboot == NULL && pciboot == NULL)
610610
return;

0 commit comments

Comments
 (0)