diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2016-01-20 19:01:40 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2016-01-20 19:01:40 +0000 |
commit | 37375a61bd2c479cf1ecdb6dfa87eb649e03f215 (patch) | |
tree | 748eb0c50c0f4ef90b77e70a0abc4a977ee3debd /sys/dev | |
parent | 7b47ad7a1182e9c2d796361782157aa1cdf60081 (diff) |
make AUDIO_GETDEV ioctl return the device name (ex "azalia0") rather
than driver specific strings.
ok kettenis
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/audio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c index c0f079ed1c8..cc6e8ccd29f 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -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> * @@ -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, |