Commit c294900a authored by Alan Cox's avatar Alan Cox Committed by Steve French

[PATCH] switch maestro3 to new ac97

parent 4a6b58ed
...@@ -2301,9 +2301,8 @@ static int __init m3_codec_install(struct m3_card *card) ...@@ -2301,9 +2301,8 @@ static int __init m3_codec_install(struct m3_card *card)
{ {
struct ac97_codec *codec; struct ac97_codec *codec;
if ((codec = kmalloc(sizeof(struct ac97_codec), GFP_KERNEL)) == NULL) if ((codec = ac97_alloc_codec()) == NULL)
return -ENOMEM; return -ENOMEM;
memset(codec, 0, sizeof(struct ac97_codec));
codec->private_data = card; codec->private_data = card;
codec->codec_read = m3_ac97_read; codec->codec_read = m3_ac97_read;
...@@ -2313,13 +2312,13 @@ static int __init m3_codec_install(struct m3_card *card) ...@@ -2313,13 +2312,13 @@ static int __init m3_codec_install(struct m3_card *card)
if (ac97_probe_codec(codec) == 0) { if (ac97_probe_codec(codec) == 0) {
printk(KERN_ERR PFX "codec probe failed\n"); printk(KERN_ERR PFX "codec probe failed\n");
kfree(codec); ac97_release_codec(codec);
return -1; return -1;
} }
if ((codec->dev_mixer = register_sound_mixer(&m3_mixer_fops, -1)) < 0) { if ((codec->dev_mixer = register_sound_mixer(&m3_mixer_fops, -1)) < 0) {
printk(KERN_ERR PFX "couldn't register mixer!\n"); printk(KERN_ERR PFX "couldn't register mixer!\n");
kfree(codec); ac97_release_codec(codec);
return -1; return -1;
} }
......
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