]> err.no Git - linux-2.6/blobdiff - sound/ppc/pmac.c
Merge branch 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[linux-2.6] / sound / ppc / pmac.c
index a642e4cfcf45e2188104b0b4488f26c6d6c12e97..f0794ef9d1ac06ffc404fcb353885a2e66593fea 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);
@@ -869,7 +869,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
 
        u32 layout_id = 0;
 
-       if (_machine != _MACH_Pmac)
+       if (!machine_is(powermac))
                return -ENODEV;
 
        chip->subframe = 0;
@@ -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]);