/* Release an allocated AC97 codec. This will be refcounted in time but for the moment is trivial. Calls the unregister handler if the codec is now defunct.  */
void ac97_release_codec(struct ac97_codec *codec)
/* Release an allocated AC97 codec. This will be refcounted in time but for the moment is trivial. Calls the unregister handler if the codec is now defunct.  */
void ac97_release_codec(struct ac97_codec *codec)
{
	mutex_lock(&codec_mutex);
	list_del(&codec->list);
	mutex_unlock(&codec_mutex);
	if(codec->driver)
		codec->driver->remove(codec, codec->driver);
	kfree(codec);
}