summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-04-07 09:37:33 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-04-07 09:37:33 +0000
commit2bc292d1681c9565b574c3c0854ddd661925dbed (patch)
tree765845f925262f2dc45ece21e5f6bd40ff0c6602 /sys/kern
parentcf94c743e69f681f92a06a68fda4c14836fcfd80 (diff)
Fix kernel builds with pseudo-device rd
Make the cf_attach member of struct cfdata const and sprinkle a few const into subr_autoconf.c to make this work. Fixes the compilation of sys/dev/rd.c with newly const rd_ca. ok miod (who had a similar diff)
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_autoconf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index eccf09d10e8..a35b2224724 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_autoconf.c,v 1.95 2021/10/26 16:29:49 deraadt Exp $ */
+/* $OpenBSD: subr_autoconf.c,v 1.96 2022/04/07 09:37:32 tb Exp $ */
/* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */
/*
@@ -348,7 +348,7 @@ config_attach(struct device *parent, void *match, void *aux, cfprint_t print)
struct cfdata *cf;
struct device *dev;
struct cfdriver *cd;
- struct cfattach *ca;
+ const struct cfattach *ca;
mtx_enter(&autoconf_attdet_mtx);
while (autoconf_attdet < 0)
@@ -428,7 +428,7 @@ config_make_softc(struct device *parent, struct cfdata *cf)
{
struct device *dev;
struct cfdriver *cd;
- struct cfattach *ca;
+ const struct cfattach *ca;
cd = cf->cf_driver;
ca = cf->cf_attach;
@@ -507,7 +507,7 @@ int
config_detach(struct device *dev, int flags)
{
struct cfdata *cf;
- struct cfattach *ca;
+ const struct cfattach *ca;
struct cfdriver *cd;
int rv = 0, i;
#ifdef DIAGNOSTIC
@@ -816,7 +816,7 @@ config_detach_children(struct device *parent, int flags)
int
config_suspend(struct device *dev, int act)
{
- struct cfattach *ca = dev->dv_cfdata->cf_attach;
+ const struct cfattach *ca = dev->dv_cfdata->cf_attach;
int r;
device_ref(dev);
@@ -998,7 +998,7 @@ device_ref(struct device *dv)
void
device_unref(struct device *dv)
{
- struct cfattach *ca;
+ const struct cfattach *ca;
if (atomic_dec_int_nv(&dv->dv_ref) == 0) {
ca = dv->dv_cfdata->cf_attach;