]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/sh/aica.c
Merge branch 'topic/snd_card_new-err' into topic/cs423x-merge
[linux-2.6-omap-h63xx.git] / sound / sh / aica.c
index 54df8baf916f4f8462c0a44105bf49c6c0bb3e6d..f551233c5a08d6958c14caebe24a1e227257e829 100644 (file)
@@ -106,7 +106,8 @@ static void spu_memset(u32 toi, u32 what, int length)
 {
        int i;
        unsigned long flags;
-       snd_assert(length % 4 == 0, return);
+       if (snd_BUG_ON(length % 4))
+               return;
        for (i = 0; i < length; i++) {
                if (!(i % 8))
                        spu_write_wait();
@@ -589,7 +590,7 @@ static int __devinit add_aicamixer_controls(struct snd_card_aica
        return 0;
 }
 
-static int snd_aica_remove(struct platform_device *devptr)
+static int __devexit snd_aica_remove(struct platform_device *devptr)
 {
        struct snd_card_aica *dreamcastcard;
        dreamcastcard = platform_get_drvdata(devptr);
@@ -601,18 +602,18 @@ static int snd_aica_remove(struct platform_device *devptr)
        return 0;
 }
 
-static int __init snd_aica_probe(struct platform_device *devptr)
+static int __devinit snd_aica_probe(struct platform_device *devptr)
 {
        int err;
        struct snd_card_aica *dreamcastcard;
        dreamcastcard = kmalloc(sizeof(struct snd_card_aica), GFP_KERNEL);
        if (unlikely(!dreamcastcard))
                return -ENOMEM;
-       dreamcastcard->card =
-           snd_card_new(index, SND_AICA_DRIVER, THIS_MODULE, 0);
-       if (unlikely(!dreamcastcard->card)) {
+       err = snd_card_create(index, SND_AICA_DRIVER, THIS_MODULE, 0,
+                             &dreamcastcard->card);
+       if (unlikely(err < 0)) {
                kfree(dreamcastcard);
-               return -ENODEV;
+               return err;
        }
        strcpy(dreamcastcard->card->driver, "snd_aica");
        strcpy(dreamcastcard->card->shortname, SND_AICA_DRIVER);
@@ -650,7 +651,7 @@ static int __init snd_aica_probe(struct platform_device *devptr)
 
 static struct platform_driver snd_aica_driver = {
        .probe = snd_aica_probe,
-       .remove = snd_aica_remove,
+       .remove = __devexit_p(snd_aica_remove),
        .driver = {
                   .name = SND_AICA_DRIVER},
 };