summaryrefslogtreecommitdiffstats
path: root/sys/isa/syscons_isa.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-01-29 15:08:56 +0000
committerpeter <peter@FreeBSD.org>2000-01-29 15:08:56 +0000
commitd7e5eb3faac173e7d9640e098621746b86213739 (patch)
tree9a2474b2f7c68ec2b1e97af2ab3b083c722e9ad7 /sys/isa/syscons_isa.c
parente06faf1d941fbd0cfd397f781f3986049ecce128 (diff)
downloadFreeBSD-src-d7e5eb3faac173e7d9640e098621746b86213739.zip
FreeBSD-src-d7e5eb3faac173e7d9640e098621746b86213739.tar.gz
Use config's conditional compilation rather than using #ifdefs that make
modular compilation harder. I'm doing this because people seem to like cut/pasting examples of bad practices in existing code.
Diffstat (limited to 'sys/isa/syscons_isa.c')
-rw-r--r--sys/isa/syscons_isa.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/isa/syscons_isa.c b/sys/isa/syscons_isa.c
index cbaa1b8..4137f15 100644
--- a/sys/isa/syscons_isa.c
+++ b/sys/isa/syscons_isa.c
@@ -26,11 +26,8 @@
* $FreeBSD$
*/
-#include "sc.h"
#include "opt_syscons.h"
-#if NSC > 0
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -118,13 +115,15 @@ sc_softc_t
{
sc_softc_t *sc;
- if ((unit < 0) || (unit >= NSC))
+ if (unit < 0)
return NULL;
if (flags & SC_KERNEL_CONSOLE) {
/* FIXME: clear if it is wired to another unit! */
sc = &main_softc;
} else {
sc = (sc_softc_t *)device_get_softc(devclass_get_device(sc_devclass, unit));
+ if (sc == NULL)
+ return NULL;
}
sc->unit = unit;
if (!(sc->flags & SC_INIT_DONE)) {
@@ -242,5 +241,3 @@ sc_tone(int herz)
}
DRIVER_MODULE(sc, isa, sc_driver, sc_devclass, 0, 0);
-
-#endif /* NSC > 0 */
OpenPOWER on IntegriCloud