> Date: Wed, 20 Jan 2016 09:13:53 +0100
> From: Alexandre Ratchov <a...@caoua.org>
> 
> This diff makes audioctl(1) display the device name (ex. 
> "azalia0", "cmpci0", etc) in the "name" attribute.  This way
> audioctl(1) output could be correlated with dmesg output.  This
> seems more useful than strings like "HD-Audio" or "CMI8338A".
> 
> OK?

There is a small chance that something in ports uses these strings as
keys to store values.  This change would introduce a flag day for such
applications, but in the long run using the driver instance name would
help.  Except for hotplugging multiple uaudio(4) devices of course...

Anyway, I think this is ok.

But you should probably remove the ops->getdev() driver callback if
this sticks.


> Index: audio.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/audio.c,v retrieving revision 1.142 diff
> -u -p -u -p -r1.142 audio.c --- audio.c 20 Jan 2016 07:59:55 -0000
> 1.142 +++ audio.c 20 Jan 2016 08:04:29 -0000 @@ -1584,7 +1584,11 @@
> audio_ioctl(struct audio_softc *sc, unsi 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,
> 
> 

Reply via email to