ALSA: Simplify snd_device_register() variants

Now that all callers have been replaced with
snd_device_register_for_dev(), let's drop the obsolete device
registration code and concentrate only on the code handling struct
device directly.  That said,

- remove the old snd_device_register(),
- rename snd_device_register_for_dev() with snd_device_register(),
- drop superfluous arguments from snd_device_register(),
- change snd_unregister_device() to pass the device pointer directly

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tento commit je obsažen v:
Takashi Iwai
2015-01-30 08:34:58 +01:00
rodič 04c5d5a430
revize 40a4b26385
9 změnil soubory, kde provedl 55 přidání a 121 odebrání

Zobrazit soubor

@@ -2586,9 +2586,8 @@ int __init snd_sequencer_device_init(void)
if (mutex_lock_interruptible(&register_mutex))
return -ERESTARTSYS;
err = snd_register_device_for_dev(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0,
&snd_seq_f_ops, NULL,
&seq_dev, NULL, NULL);
err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0,
&snd_seq_f_ops, NULL, &seq_dev);
if (err < 0) {
mutex_unlock(&register_mutex);
put_device(&seq_dev);
@@ -2607,6 +2606,6 @@ int __init snd_sequencer_device_init(void)
*/
void __exit snd_sequencer_device_done(void)
{
snd_unregister_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0);
snd_unregister_device(&seq_dev);
put_device(&seq_dev);
}