/* Returns zero if sucecessful, or a negative error code on failure  */
int snd_unregister_device(int type, struct snd_card *card, int dev)
/* Returns zero if sucecessful, or a negative error code on failure  */
int snd_unregister_device(int type, struct snd_card *card, int dev)
{
	int minor;
	mutex_lock(&sound_mutex);
	minor = find_snd_minor(type, card, dev);
	if (minor < 0) {
		mutex_unlock(&sound_mutex);
		return -EINVAL;
	}
	device_destroy(sound_class, MKDEV(major, minor));
	kfree(snd_minors[minor]);
	snd_minors[minor] = NULL;
	mutex_unlock(&sound_mutex);
	return 0;
}