mirror of https://github.com/ericonr/sndio.git
Call dev_ctlsync(), even if there's no control device
In the dev_reopen() code-path, the controls of the old device were removed so all clients must be notified about the controls change.
This commit is contained in:
parent
ea0520142e
commit
fab9b7cb7e
|
@ -116,8 +116,16 @@ dev_sioctl_onval(void *arg, unsigned int addr, unsigned int val)
|
||||||
void
|
void
|
||||||
dev_sioctl_open(struct dev *d)
|
dev_sioctl_open(struct dev *d)
|
||||||
{
|
{
|
||||||
if (d->sioctl.hdl == NULL)
|
if (d->sioctl.hdl == NULL) {
|
||||||
|
/*
|
||||||
|
* At this point there are clients, for instance if we're
|
||||||
|
* called by dev_reopen() but the control device couldn't
|
||||||
|
* be opened. In this case controls have changed (thoseof
|
||||||
|
* old device are just removed) so we need to notify clients.
|
||||||
|
*/
|
||||||
|
dev_ctlsync(d);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
sioctl_ondesc(d->sioctl.hdl, dev_sioctl_ondesc, d);
|
sioctl_ondesc(d->sioctl.hdl, dev_sioctl_ondesc, d);
|
||||||
sioctl_onval(d->sioctl.hdl, dev_sioctl_onval, d);
|
sioctl_onval(d->sioctl.hdl, dev_sioctl_onval, d);
|
||||||
d->sioctl.file = file_new(&dev_sioctl_ops, d, "mix",
|
d->sioctl.file = file_new(&dev_sioctl_ops, d, "mix",
|
||||||
|
|
Loading…
Reference in New Issue