summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2007-01-18 19:19:19 +0000
committermarius <marius@FreeBSD.org>2007-01-18 19:19:19 +0000
commita312b87531ac2951f73f0137a9d8b5b36f53784a (patch)
tree09bd0d91113afdbf5650693c38cbabb61873f524 /sys/dev/sound
parentd7c0868be350640ac572c455d538fb72de85cacb (diff)
downloadFreeBSD-src-a312b87531ac2951f73f0137a9d8b5b36f53784a.zip
FreeBSD-src-a312b87531ac2951f73f0137a9d8b5b36f53784a.tar.gz
- Probe the CS4231 in USIII machines.
- Remove unused variables. [1] Reported by: Coverity Prevent (CID 700, 701) [1]
Diffstat (limited to 'sys/dev/sound')
-rw-r--r--sys/dev/sound/sbus/cs4231.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/sound/sbus/cs4231.c b/sys/dev/sound/sbus/cs4231.c
index af85c8a..695b9e7 100644
--- a/sys/dev/sound/sbus/cs4231.c
+++ b/sys/dev/sound/sbus/cs4231.c
@@ -306,10 +306,12 @@ MIXER_DECLARE(cs4231_mixer);
static int
cs4231_bus_probe(device_t dev)
{
- const char *name;
+ const char *compat, *name;
+ compat = ofw_bus_get_compat(dev);
name = ofw_bus_get_name(dev);
- if (strcmp("SUNW,CS4231", name) == 0) {
+ if (strcmp("SUNW,CS4231", name) == 0 ||
+ (compat != NULL && strcmp("SUNW,CS4231", compat) == 0)) {
device_set_desc(dev, "Sun Audiocs");
return (BUS_PROBE_DEFAULT);
}
@@ -319,11 +321,9 @@ cs4231_bus_probe(device_t dev)
static int
cs4231_sbus_attach(device_t dev)
{
- struct snddev_info *d;
struct cs4231_softc *sc;
int burst;
- d = device_get_softc(dev);
sc = malloc(sizeof(struct cs4231_softc), M_DEVBUF, M_NOWAIT | M_ZERO);
if (sc == NULL) {
device_printf(dev, "cannot allocate softc\n");
@@ -352,10 +352,8 @@ cs4231_sbus_attach(device_t dev)
static int
cs4231_ebus_attach(device_t dev)
{
- struct snddev_info *d;
struct cs4231_softc *sc;
- d = device_get_softc(dev);
sc = malloc(sizeof(struct cs4231_softc), M_DEVBUF, M_NOWAIT | M_ZERO);
if (sc == NULL) {
device_printf(dev, "cannot allocate softc\n");
OpenPOWER on IntegriCloud