diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/ppc/pmac.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 5a2bef44a2f5..7a22f0f3784a 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c | |||
@@ -775,7 +775,8 @@ static int snd_pmac_free(struct snd_pmac *chip) | |||
775 | out_le32(&chip->awacs->control, in_le32(&chip->awacs->control) & 0xfff); | 775 | out_le32(&chip->awacs->control, in_le32(&chip->awacs->control) & 0xfff); |
776 | } | 776 | } |
777 | 777 | ||
778 | snd_pmac_sound_feature(chip, 0); | 778 | if (chip->node) |
779 | snd_pmac_sound_feature(chip, 0); | ||
779 | 780 | ||
780 | /* clean up mixer if any */ | 781 | /* clean up mixer if any */ |
781 | if (chip->mixer_free) | 782 | if (chip->mixer_free) |
@@ -925,6 +926,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip) | |||
925 | } | 926 | } |
926 | if (! sound) { | 927 | if (! sound) { |
927 | of_node_put(chip->node); | 928 | of_node_put(chip->node); |
929 | chip->node = NULL; | ||
928 | return -ENODEV; | 930 | return -ENODEV; |
929 | } | 931 | } |
930 | prop = of_get_property(sound, "sub-frame", NULL); | 932 | prop = of_get_property(sound, "sub-frame", NULL); |
@@ -937,7 +939,9 @@ static int __init snd_pmac_detect(struct snd_pmac *chip) | |||
937 | printk(KERN_INFO "snd-powermac no longer handles any " | 939 | printk(KERN_INFO "snd-powermac no longer handles any " |
938 | "machines with a layout-id property " | 940 | "machines with a layout-id property " |
939 | "in the device-tree, use snd-aoa.\n"); | 941 | "in the device-tree, use snd-aoa.\n"); |
942 | of_node_put(sound); | ||
940 | of_node_put(chip->node); | 943 | of_node_put(chip->node); |
944 | chip->node = NULL; | ||
941 | return -ENODEV; | 945 | return -ENODEV; |
942 | } | 946 | } |
943 | /* This should be verified on older screamers */ | 947 | /* This should be verified on older screamers */ |
@@ -1297,8 +1301,6 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) | |||
1297 | return 0; | 1301 | return 0; |
1298 | 1302 | ||
1299 | __error: | 1303 | __error: |
1300 | if (chip->pdev) | ||
1301 | pci_dev_put(chip->pdev); | ||
1302 | snd_pmac_free(chip); | 1304 | snd_pmac_free(chip); |
1303 | return err; | 1305 | return err; |
1304 | } | 1306 | } |