Skip to content

Commit

Permalink
make AUDIO_GETDEV ioctl return the device name (ex "azalia0") rather
Browse files Browse the repository at this point in the history
than driver specific strings.

ok kettenis
  • Loading branch information
ratchov committed Jan 20, 2016
1 parent 80bc964 commit 9f7eb5c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sys/dev/audio.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: audio.c,v 1.142 2016/01/20 07:59:55 ratchov Exp $ */
/* $OpenBSD: audio.c,v 1.143 2016/01/20 19:01:39 ratchov Exp $ */
/*
* Copyright (c) 2015 Alexandre Ratchov <alex@caoua.org>
*
Expand Down Expand Up @@ -1584,7 +1584,11 @@ audio_ioctl(struct audio_softc *sc, unsigned long cmd, void *addr)
error = audio_getinfo(sc, (struct audio_info *)addr);
break;
case AUDIO_GETDEV:
error = sc->ops->getdev(sc->arg, (audio_device_t *)addr);
memset(addr, 0, sizeof(struct audio_device));
if (sc->dev.dv_parent)
strlcpy(((struct audio_device *)addr)->name,
sc->dev.dv_parent->dv_xname,
MAX_AUDIO_DEV_LEN);
break;
case AUDIO_GETENC:
error = sc->ops->query_encoding(sc->arg,
Expand Down

0 comments on commit 9f7eb5c

Please sign in to comment.