]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - sound/sparc/dbri.c
[ALSA] Add snd_card_set_generic_dev() call
[karo-tx-linux.git] / sound / sparc / dbri.c
index 941c7b1e7ebb959ed49e1077aa2dad14b99c4bdb..a56f81bb0049c8926019dea683e387aea393268f 100644 (file)
@@ -2657,26 +2657,20 @@ static int __init dbri_attach(int prom_node, struct sbus_dev *sdev)
        }
 
        dbri = (snd_dbri_t *) card->private_data;
-       if ((err = snd_dbri_pcm(dbri)) < 0) {
-               snd_dbri_free(dbri);
-               snd_card_free(card);
-               return err;
-       }
+       if ((err = snd_dbri_pcm(dbri)) < 0)
+               goto _err;
 
-       if ((err = snd_dbri_mixer(dbri)) < 0) {
-               snd_dbri_free(dbri);
-               snd_card_free(card);
-               return err;
-       }
+       if ((err = snd_dbri_mixer(dbri)) < 0)
+               goto _err;
 
        /* /proc file handling */
        snd_dbri_proc(dbri);
 
-       if ((err = snd_card_register(card)) < 0) {
-               snd_dbri_free(dbri);
-               snd_card_free(card);
-               return err;
-       }
+       if ((err = snd_card_set_generic_dev(card)) < 0)
+               goto _err;
+
+       if ((err = snd_card_register(card)) < 0)
+               goto _err;
 
        printk(KERN_INFO "audio%d at %p (irq %d) is DBRI(%c)+CS4215(%d)\n",
               dev, dbri->regs,
@@ -2684,6 +2678,11 @@ static int __init dbri_attach(int prom_node, struct sbus_dev *sdev)
        dev++;
 
        return 0;
+
+ _err:
+       snd_dbri_free(dbri);
+       snd_card_free(card);
+       return err;
 }
 
 /* Probe for the dbri chip and then attach the driver. */