summaryrefslogtreecommitdiff
path: root/sys/dev/dt
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-04-23 07:21:03 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-04-23 07:21:03 +0000
commit827c63ffd38bb6415b483d650b85ba7b0e5611d0 (patch)
treed4e72a50eb1a9316ee15c3e4750253aa011716c7 /sys/dev/dt
parentbd5e9f7d3d49e98aca1ea6968f193b87cc18c7ac (diff)
Remove the sysctl kern.allowdt code from kernel if dt(4) is not
configured. This will result in a "value is not available" error from sysctl when trying to enable dt on a kernel without support. The variable allowdt should be in the device, not in sysctl source. We don't need #ifdef for extern and prototypes. OK mpi@
Diffstat (limited to 'sys/dev/dt')
-rw-r--r--sys/dev/dt/dt_dev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/dt/dt_dev.c b/sys/dev/dt/dt_dev.c
index a78775ac779..1e59e22431d 100644
--- a/sys/dev/dt/dt_dev.c
+++ b/sys/dev/dt/dt_dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dt_dev.c,v 1.12 2021/03/26 21:17:10 bluhm Exp $ */
+/* $OpenBSD: dt_dev.c,v 1.13 2021/04/23 07:21:02 bluhm Exp $ */
/*
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
@@ -109,6 +109,8 @@ SIMPLEQ_HEAD(, dt_probe) dt_probe_list; /* [I] list of probes */
struct rwlock dt_lock = RWLOCK_INITIALIZER("dtlk");
volatile uint32_t dt_tracing = 0; /* [K] # of processes tracing */
+int allowdt;
+
void dtattach(struct device *, struct device *, void *);
int dtopen(dev_t, int, int, struct proc *);
int dtclose(dev_t, int, int, struct proc *);
@@ -145,7 +147,6 @@ dtopen(dev_t dev, int flags, int mode, struct proc *p)
{
struct dt_softc *sc;
int unit = minor(dev);
- extern int allowdt;
if (!allowdt)
return EPERM;