222 |
kctl.id.device = ncontrol->device; |
kctl.id.device = ncontrol->device; |
223 |
kctl.id.subdevice = ncontrol->subdevice; |
kctl.id.subdevice = ncontrol->subdevice; |
224 |
if (ncontrol->name) |
if (ncontrol->name) |
225 |
strncpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name)-1); |
strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name)); |
226 |
kctl.id.index = ncontrol->index; |
kctl.id.index = ncontrol->index; |
227 |
kctl.count = ncontrol->count ? ncontrol->count : 1; |
kctl.count = ncontrol->count ? ncontrol->count : 1; |
228 |
access = ncontrol->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE : |
access = ncontrol->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE : |
445 |
memset(&info, 0, sizeof(info)); |
memset(&info, 0, sizeof(info)); |
446 |
down_read(&snd_ioctl_rwsem); |
down_read(&snd_ioctl_rwsem); |
447 |
info.card = card->number; |
info.card = card->number; |
448 |
strncpy(info.id, card->id, sizeof(info.id) - 1); |
strlcpy(info.id, card->id, sizeof(info.id)); |
449 |
strncpy(info.driver, card->driver, sizeof(info.driver) - 1); |
strlcpy(info.driver, card->driver, sizeof(info.driver)); |
450 |
strncpy(info.name, card->shortname, sizeof(info.name) - 1); |
strlcpy(info.name, card->shortname, sizeof(info.name)); |
451 |
strncpy(info.longname, card->longname, sizeof(info.longname) - 1); |
strlcpy(info.longname, card->longname, sizeof(info.longname)); |
452 |
strncpy(info.mixername, card->mixername, sizeof(info.mixername) - 1); |
strlcpy(info.mixername, card->mixername, sizeof(info.mixername)); |
453 |
strncpy(info.components, card->components, sizeof(info.components) - 1); |
strlcpy(info.components, card->components, sizeof(info.components)); |
454 |
up_read(&snd_ioctl_rwsem); |
up_read(&snd_ioctl_rwsem); |
455 |
if (copy_to_user((void *) arg, &info, sizeof(snd_ctl_card_info_t))) |
if (copy_to_user((void *) arg, &info, sizeof(snd_ctl_card_info_t))) |
456 |
return -EFAULT; |
return -EFAULT; |
927 |
|
|
928 |
static struct file_operations snd_ctl_f_ops = |
static struct file_operations snd_ctl_f_ops = |
929 |
{ |
{ |
|
#ifndef LINUX_2_2 |
|
930 |
.owner = THIS_MODULE, |
.owner = THIS_MODULE, |
|
#endif |
|
931 |
.read = snd_ctl_read, |
.read = snd_ctl_read, |
932 |
.open = snd_ctl_open, |
.open = snd_ctl_open, |
933 |
.release = snd_ctl_release, |
.release = snd_ctl_release, |