/* Checks that a minor device with the specified type is registered, and returns its user data pointer.  */
void* snd_lookup_minor_data(unsigned int minor, int type)
/* Checks that a minor device with the specified type is registered, and returns its user data pointer.  */
void* snd_lookup_minor_data(unsigned int minor, int type)
{
	struct snd_minor *mreg;
	void *private_data;
	if (minor >= ARRAY_SIZE(snd_minors))
		return NULL;
	mutex_lock(&sound_mutex);
	mreg = snd_minors[minor];
	if (mreg && mreg->type == type)
		private_data = mreg->private_data;
	else
		private_data = NULL;
	mutex_unlock(&sound_mutex);
	return private_data;
}