diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-30 08:04:21 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-02-02 14:42:45 +0100 |
commit | 5205388d2d6dbdc5cb743c4e3f61acb9a5e5794f (patch) | |
tree | c86b78dec4a374b26d9784b88e599052adc4e619 /sound/core | |
parent | 89da061f0a556f1324d8ac84f1012107bf08d2e1 (diff) | |
download | op-kernel-dev-5205388d2d6dbdc5cb743c4e3f61acb9a5e5794f.zip op-kernel-dev-5205388d2d6dbdc5cb743c4e3f61acb9a5e5794f.tar.gz |
ALSA: seq: Handle the device directly
Like the previous change for the timer device, this patch changes the
device management for the ALSA sequencer device using the struct
device directly.
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/seq/seq_clientmgr.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index 225c7315..65b320e 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c @@ -2571,6 +2571,8 @@ static const struct file_operations snd_seq_f_ops = .compat_ioctl = snd_seq_ioctl_compat, }; +static struct device seq_dev; + /* * register sequencer device */ @@ -2578,12 +2580,18 @@ int __init snd_sequencer_device_init(void) { int err; + snd_device_initialize(&seq_dev, NULL); + dev_set_name(&seq_dev, "seq"); + if (mutex_lock_interruptible(®ister_mutex)) return -ERESTARTSYS; - if ((err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0, - &snd_seq_f_ops, NULL, "seq")) < 0) { + err = snd_register_device_for_dev(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0, + &snd_seq_f_ops, NULL, + &seq_dev, NULL, NULL); + if (err < 0) { mutex_unlock(®ister_mutex); + put_device(&seq_dev); return err; } @@ -2600,4 +2608,5 @@ int __init snd_sequencer_device_init(void) void __exit snd_sequencer_device_done(void) { snd_unregister_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0); + put_device(&seq_dev); } |