Commit c2d6098c authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ac97 OSS driver removal fix

From: Andrew Zabolotny <zap@homelink.ru>

ac97_unregister_driver() is nulling out the ->driver field for all codecs.
It should only null the codecs which are using this driver.
parent c92a441a
......@@ -1428,9 +1428,8 @@ EXPORT_SYMBOL_GPL(ac97_register_driver);
* ac97_unregister_driver - unregister a codec helper
* @driver: Driver handler
*
* Register a handler for codecs matching the codec id. The handler
* attach function is called for all present codecs and will be
* called when new codecs are discovered.
* Unregister a handler for codecs matching the codec id. The handler
* remove function is called for all matching codecs.
*/
void ac97_unregister_driver(struct ac97_driver *driver)
......@@ -1444,10 +1443,11 @@ void ac97_unregister_driver(struct ac97_driver *driver)
list_for_each(l, &codecs)
{
c = list_entry(l, struct ac97_codec, list);
if(c->driver == driver)
if (c->driver == driver) {
driver->remove(c, driver);
c->driver = NULL;
}
}
up(&codec_sem);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment