aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-30 02:39:40 -0500
committerTakashi Iwai <tiwai@suse.de>2015-02-02 11:01:38 -0500
commit830953c0724b42be30a74febcde6c89c706ed286 (patch)
tree5f647e3a5b09133b9af0f5c1023132624ca7a833
parent40a4b263854346fe7c7d1c3964c106296f690816 (diff)
ALSA: Drop snd_get_device() helper
Since the device is no longer hidden but embedded into each component, we no longer need snd_get_device(). Let's drop it and relevant codes. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/sound/core.h1
-rw-r--r--sound/core/sound.c43
2 files changed, 0 insertions, 44 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index 67ac309bb218..58882bfacdd7 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -214,7 +214,6 @@ int snd_register_device(int type, struct snd_card *card, int dev,
214 void *private_data, struct device *device); 214 void *private_data, struct device *device);
215int snd_unregister_device(struct device *dev); 215int snd_unregister_device(struct device *dev);
216void *snd_lookup_minor_data(unsigned int minor, int type); 216void *snd_lookup_minor_data(unsigned int minor, int type);
217struct device *snd_get_device(int type, struct snd_card *card, int dev);
218 217
219#ifdef CONFIG_SND_OSSEMUL 218#ifdef CONFIG_SND_OSSEMUL
220int snd_register_oss_device(int type, struct snd_card *card, int dev, 219int snd_register_oss_device(int type, struct snd_card *card, int dev,
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 2e8aeb18d76b..185cec01ee25 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -303,24 +303,6 @@ int snd_register_device(int type, struct snd_card *card, int dev,
303} 303}
304EXPORT_SYMBOL(snd_register_device); 304EXPORT_SYMBOL(snd_register_device);
305 305
306/* find the matching minor record
307 * return the index of snd_minor, or -1 if not found
308 */
309static int find_snd_minor(int type, struct snd_card *card, int dev)
310{
311 int cardnum, minor;
312 struct snd_minor *mptr;
313
314 cardnum = card ? card->number : -1;
315 for (minor = 0; minor < ARRAY_SIZE(snd_minors); ++minor)
316 if ((mptr = snd_minors[minor]) != NULL &&
317 mptr->type == type &&
318 mptr->card == cardnum &&
319 mptr->device == dev)
320 return minor;
321 return -1;
322}
323
324/** 306/**
325 * snd_unregister_device - unregister the device on the given card 307 * snd_unregister_device - unregister the device on the given card
326 * @dev: the device instance 308 * @dev: the device instance
@@ -352,31 +334,6 @@ int snd_unregister_device(struct device *dev)
352} 334}
353EXPORT_SYMBOL(snd_unregister_device); 335EXPORT_SYMBOL(snd_unregister_device);
354 336
355/**
356 * snd_get_device - get the assigned device to the given type and device number
357 * @type: the device type, SNDRV_DEVICE_TYPE_XXX
358 * @card:the card instance
359 * @dev: the device index
360 *
361 * The caller needs to release it via put_device() after using it.
362 */
363struct device *snd_get_device(int type, struct snd_card *card, int dev)
364{
365 int minor;
366 struct device *d = NULL;
367
368 mutex_lock(&sound_mutex);
369 minor = find_snd_minor(type, card, dev);
370 if (minor >= 0) {
371 d = snd_minors[minor]->dev;
372 if (d)
373 get_device(d);
374 }
375 mutex_unlock(&sound_mutex);
376 return d;
377}
378EXPORT_SYMBOL(snd_get_device);
379
380#ifdef CONFIG_PROC_FS 337#ifdef CONFIG_PROC_FS
381/* 338/*
382 * INFO PART 339 * INFO PART