117 |
snd_use_lock_init(&rec->use_lock); |
snd_use_lock_init(&rec->use_lock); |
118 |
|
|
119 |
/* copy and truncate the name of synth device */ |
/* copy and truncate the name of synth device */ |
120 |
strncpy(rec->name, dev->name, sizeof(rec->name)); |
strlcpy(rec->name, dev->name, sizeof(rec->name)); |
|
rec->name[sizeof(rec->name)-1] = 0; |
|
121 |
|
|
122 |
/* registration */ |
/* registration */ |
123 |
spin_lock_irqsave(®ister_lock, flags); |
spin_lock_irqsave(®ister_lock, flags); |
449 |
*/ |
*/ |
450 |
int |
int |
451 |
snd_seq_oss_synth_load_patch(seq_oss_devinfo_t *dp, int dev, int fmt, |
snd_seq_oss_synth_load_patch(seq_oss_devinfo_t *dp, int dev, int fmt, |
452 |
const char *buf, int p, int c) |
const char __user *buf, int p, int c) |
453 |
{ |
{ |
454 |
seq_oss_synth_t *rec; |
seq_oss_synth_t *rec; |
455 |
int rc; |
int rc; |
610 |
inf->synth_subtype = 0; |
inf->synth_subtype = 0; |
611 |
inf->nr_voices = 16; |
inf->nr_voices = 16; |
612 |
inf->device = dev; |
inf->device = dev; |
613 |
strncpy(inf->name, minf.name, sizeof(inf->name)); |
strlcpy(inf->name, minf.name, sizeof(inf->name)); |
614 |
} else { |
} else { |
615 |
if ((rec = get_synthdev(dp, dev)) == NULL) |
if ((rec = get_synthdev(dp, dev)) == NULL) |
616 |
return -ENXIO; |
return -ENXIO; |
618 |
inf->synth_subtype = rec->synth_subtype; |
inf->synth_subtype = rec->synth_subtype; |
619 |
inf->nr_voices = rec->nr_voices; |
inf->nr_voices = rec->nr_voices; |
620 |
inf->device = dev; |
inf->device = dev; |
621 |
strncpy(inf->name, rec->name, sizeof(inf->name)); |
strlcpy(inf->name, rec->name, sizeof(inf->name)); |
622 |
snd_use_lock_free(&rec->use_lock); |
snd_use_lock_free(&rec->use_lock); |
623 |
} |
} |
624 |
return 0; |
return 0; |