diff options
| author | pgoyette <pgoyette@NetBSD.org> | 2016-12-15 06:48:14 +0000 |
|---|---|---|
| committer | pgoyette <pgoyette@NetBSD.org> | 2016-12-15 06:48:14 +0000 |
| commit | 2f32f7122b76df79176f5ac8b3e82f3e2a47d903 (patch) | |
| tree | 4cf031ba03bb855f7dcfe7aebce48e2c71cb6c1c /sys/dev | |
| parent | 3a9ec3b13fff7973ac1a0f8812f8fe79bff977a0 (diff) | |
Create a single combined module for spkr_pcppi and spkr_audio, and
build it for all architectures.
By doing this, we can handle pcppi, audio, or both attachments with
non-built-in modules.
XXX Still to do: the module currently cannot be unloaded, and the
XXX spkr device(s) currently cannot be detached. (Really, two
XXX sides of the same problem.)
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/isa/spkr_pcppi.c | 13 | ||||
| -rw-r--r-- | sys/dev/spkr_audio.c | 13 | ||||
| -rw-r--r-- | sys/dev/spkrvar.h | 3 |
3 files changed, 5 insertions, 24 deletions
diff --git a/sys/dev/isa/spkr_pcppi.c b/sys/dev/isa/spkr_pcppi.c index d37eb1b6487..27322f351bd 100644 --- a/sys/dev/isa/spkr_pcppi.c +++ b/sys/dev/isa/spkr_pcppi.c @@ -1,4 +1,4 @@ -/* $NetBSD: spkr_pcppi.c,v 1.7 2016/12/14 22:30:42 christos Exp $ */ +/* $NetBSD: spkr_pcppi.c,v 1.8 2016/12/15 06:48:14 pgoyette Exp $ */ /* * Copyright (c) 1990 Eric S. Raymond (esr@snark.thyrsus.com) @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spkr_pcppi.c,v 1.7 2016/12/14 22:30:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spkr_pcppi.c,v 1.8 2016/12/15 06:48:14 pgoyette Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: spkr_pcppi.c,v 1.7 2016/12/14 22:30:42 christos Exp #include <sys/errno.h> #include <sys/device.h> #include <sys/malloc.h> -#include <sys/module.h> #include <sys/uio.h> #include <sys/proc.h> #include <sys/ioctl.h> @@ -76,14 +75,6 @@ static int spkr_pcppi_detach(device_t, int); CFATTACH_DECL_NEW(spkr_pcppi, sizeof(struct spkr_pcppi_softc), spkr_pcppi_probe, spkr_pcppi_attach, spkr_pcppi_detach, NULL); -MODULE(MODULE_CLASS_DRIVER, spkr, NULL /* "pcppi" */); - -static int -spkr_modcmd(modcmd_t cmd, void *arg) -{ - return spkr__modcmd(cmd, arg); -} - #define SPKRPRI (PZERO - 1) /* emit tone of frequency hz for given number of ticks */ diff --git a/sys/dev/spkr_audio.c b/sys/dev/spkr_audio.c index 996c7219d13..58b7c70ff7c 100644 --- a/sys/dev/spkr_audio.c +++ b/sys/dev/spkr_audio.c @@ -1,4 +1,4 @@ -/* $NetBSD: spkr_audio.c,v 1.1 2016/12/15 04:36:07 christos Exp $ */ +/* $NetBSD: spkr_audio.c,v 1.2 2016/12/15 06:48:14 pgoyette Exp $ */ /*- * Copyright (c) 2016 Nathanial Sloss <nathanialsloss@yahoo.com.au> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spkr_audio.c,v 1.1 2016/12/15 04:36:07 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spkr_audio.c,v 1.2 2016/12/15 06:48:14 pgoyette Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -35,7 +35,6 @@ __KERNEL_RCSID(0, "$NetBSD: spkr_audio.c,v 1.1 2016/12/15 04:36:07 christos Exp #include <sys/errno.h> #include <sys/device.h> #include <sys/malloc.h> -#include <sys/module.h> #include <sys/uio.h> #include <sys/proc.h> #include <sys/ioctl.h> @@ -77,14 +76,6 @@ struct spkr_audio_softc { CFATTACH_DECL_NEW(spkr_audio, sizeof(struct spkr_audio_softc), spkr_audio_probe, spkr_audio_attach, spkr_audio_detach, NULL); -MODULE(MODULE_CLASS_DRIVER, spkr, NULL /* "audio" */); - -static int -spkr_modcmd(modcmd_t cmd, void *arg) -{ - return spkr__modcmd(cmd, arg); -} - static void spkr_audio_tone(device_t self, u_int xhz, u_int ticks) { diff --git a/sys/dev/spkrvar.h b/sys/dev/spkrvar.h index 23dbc40f168..ae977a47772 100644 --- a/sys/dev/spkrvar.h +++ b/sys/dev/spkrvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: spkrvar.h,v 1.4 2016/12/13 20:20:34 christos Exp $ */ +/* $NetBSD: spkrvar.h,v 1.5 2016/12/15 06:48:14 pgoyette Exp $ */ #ifndef _SYS_DEV_SPKRVAR_H #define _SYS_DEV_SPKRVAR_H @@ -20,7 +20,6 @@ struct spkr_softc { void (*sc_rest)(device_t, int); }; -int spkr__modcmd(modcmd_t, void *); void spkr_attach(device_t, void (*)(device_t, u_int, u_int), void (*)(device_t, int)); |
