]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/ppc/pmac.c
[PATCH] autofs4: can't mount due to mount point dir not empty
[linux-2.6-omap-h63xx.git] / sound / ppc / pmac.c
index a642e4cfcf45e2188104b0b4488f26c6d6c12e97..aa57170101fd44dd2a090b0acd2c302bbe00e3e8 100644 (file)
@@ -66,7 +66,7 @@ static int snd_pmac_dbdma_alloc(struct snd_pmac *chip, struct pmac_dbdma *rec, i
 
 static void snd_pmac_dbdma_free(struct snd_pmac *chip, struct pmac_dbdma *rec)
 {
-       if (rec) {
+       if (rec->space) {
                unsigned int rsize = sizeof(struct dbdma_cmd) * (rec->size + 1);
 
                dma_free_coherent(&chip->pdev->dev, rsize, rec->space, rec->dma_base);
@@ -881,6 +881,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
        chip->can_capture = 1;
        chip->num_freqs = ARRAY_SIZE(awacs_freqs);
        chip->freq_table = awacs_freqs;
+       chip->pdev = NULL;
 
        chip->control_mask = MASK_IEPC | MASK_IEE | 0x11; /* default */
 
@@ -1216,7 +1217,7 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
                        goto __error;
                }
                for (i = 0; i < 3; i ++) {
-                       if (of_address_to_resource(np->parent, i,
+                       if (of_address_to_resource(np, i,
                                                   &chip->rsrc[i])) {
                                printk(KERN_ERR "snd: can't translate rsrc "
                                       " %d (%s)\n", i, rnames[i]);