aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/control.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-11-20 08:03:48 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:29:14 -0500
commit2af677fc884fc6dc79e65c99050ea607ac8bab9b (patch)
tree4291d36c2f116d5887b88da5f0213b68933a1201 /sound/core/control.c
parenta106cd3d9e88c8761bd0eac2ce402cc82bd11fea (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/control.c')
-rw-r--r--sound/core/control.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index f8f98cc52417..23561e74712b 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1264,12 +1264,6 @@ static struct file_operations snd_ctl_f_ops =
1264 .fasync = snd_ctl_fasync, 1264 .fasync = snd_ctl_fasync,
1265}; 1265};
1266 1266
1267static struct snd_minor snd_ctl_reg =
1268{
1269 .comment = "ctl",
1270 .f_ops = &snd_ctl_f_ops,
1271};
1272
1273/* 1267/*
1274 * registration of the control device 1268 * registration of the control device
1275 */ 1269 */
@@ -1284,7 +1278,7 @@ static int snd_ctl_dev_register(struct snd_device *device)
1284 snd_assert(cardnum >= 0 && cardnum < SNDRV_CARDS, return -ENXIO); 1278 snd_assert(cardnum >= 0 && cardnum < SNDRV_CARDS, return -ENXIO);
1285 sprintf(name, "controlC%i", cardnum); 1279 sprintf(name, "controlC%i", cardnum);
1286 if ((err = snd_register_device(SNDRV_DEVICE_TYPE_CONTROL, 1280 if ((err = snd_register_device(SNDRV_DEVICE_TYPE_CONTROL,
1287 card, 0, &snd_ctl_reg, name)) < 0) 1281 card, -1, &snd_ctl_f_ops, name)) < 0)
1288 return err; 1282 return err;
1289 return 0; 1283 return 0;
1290} 1284}
@@ -1336,7 +1330,8 @@ static int snd_ctl_dev_unregister(struct snd_device *device)
1336 snd_assert(card != NULL, return -ENXIO); 1330 snd_assert(card != NULL, return -ENXIO);
1337 cardnum = card->number; 1331 cardnum = card->number;
1338 snd_assert(cardnum >= 0 && cardnum < SNDRV_CARDS, return -ENXIO); 1332 snd_assert(cardnum >= 0 && cardnum < SNDRV_CARDS, return -ENXIO);
1339 if ((err = snd_unregister_device(SNDRV_DEVICE_TYPE_CONTROL, card, 0)) < 0) 1333 if ((err = snd_unregister_device(SNDRV_DEVICE_TYPE_CONTROL,
1334 card, -1)) < 0)
1340 return err; 1335 return err;
1341 return snd_ctl_dev_free(device); 1336 return snd_ctl_dev_free(device);
1342} 1337}