diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-11-20 14:03:48 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 12:29:14 +0100 |
commit | 2af677fc884fc6dc79e65c99050ea607ac8bab9b (patch) | |
tree | 4291d36c2f116d5887b88da5f0213b68933a1201 /sound/core/hwdep.c | |
parent | a106cd3d9e88c8761bd0eac2ce402cc82bd11fea (diff) |
[ALSA] dynamic minors (1/6): store device type in struct snd_minor
Instead of a comment string, store the device type in the snd_minor
structure. This makes snd_minor more flexible, and has the nice side
effect that we don't need anymore to create a separate snd_minor
template for registering a device but can pass the file_operations
directly to snd_register_device().
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/core/hwdep.c')
-rw-r--r-- | sound/core/hwdep.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index 444e266e7c48..27d5bf7266f0 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c @@ -330,12 +330,6 @@ static struct file_operations snd_hwdep_f_ops = .mmap = snd_hwdep_mmap, }; -static struct snd_minor snd_hwdep_reg = -{ - .comment = "hardware dependent", - .f_ops = &snd_hwdep_f_ops, -}; - /** * snd_hwdep_new - create a new hwdep instance * @card: the card instance @@ -416,7 +410,7 @@ static int snd_hwdep_dev_register(struct snd_device *device) sprintf(name, "hwC%iD%i", hwdep->card->number, hwdep->device); if ((err = snd_register_device(SNDRV_DEVICE_TYPE_HWDEP, hwdep->card, hwdep->device, - &snd_hwdep_reg, name)) < 0) { + &snd_hwdep_f_ops, name)) < 0) { snd_printk(KERN_ERR "unable to register hardware dependent device %i:%i\n", hwdep->card->number, hwdep->device); snd_hwdep_devices[idx] = NULL; @@ -431,7 +425,8 @@ static int snd_hwdep_dev_register(struct snd_device *device) } else { if (snd_register_oss_device(hwdep->oss_type, hwdep->card, hwdep->device, - &snd_hwdep_reg, hwdep->oss_dev) < 0) { + &snd_hwdep_f_ops, + hwdep->oss_dev) < 0) { snd_printk(KERN_ERR "unable to register OSS compatibility device %i:%i\n", hwdep->card->number, hwdep->device); } else |