diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-03-05 17:21:32 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-03-13 15:28:58 +0100 |
commit | b2a0bafa758256442e04d1f34d6d0746b846d23d (patch) | |
tree | 97f3ada5d1e4aced0254f856bf819bc9dca57b89 /sound/pci/hda/hda_tegra.c | |
parent | ALSA: hda - Release resources in device release callback (diff) | |
download | linux-b2a0bafa758256442e04d1f34d6d0746b846d23d.tar.xz linux-b2a0bafa758256442e04d1f34d6d0746b846d23d.zip |
ALSA: hda - Use shutdown driver ops instead of reboot notifier
The driver shutdown ops is simpler than registering reboot notifier
manually. There should be no functional change by this -- the codec
driver calls its own callback while the bus driver just calls
azx_stop() like before.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_tegra.c')
-rw-r--r-- | sound/pci/hda/hda_tegra.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c index 7586abe91dfb..2e4fd5c56d3b 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c @@ -290,8 +290,6 @@ static int hda_tegra_dev_free(struct snd_device *device) int i; struct azx *chip = device->device_data; - azx_notifier_unregister(chip); - if (chip->initialized) { for (i = 0; i < chip->num_streams; i++) azx_stream_stop(chip, &chip->azx_dev[i]); @@ -502,7 +500,6 @@ static int hda_tegra_probe(struct platform_device *pdev) goto out_free; chip->running = 1; - azx_notifier_register(chip); snd_hda_set_power_save(chip->bus, power_save * 1000); return 0; @@ -517,6 +514,18 @@ static int hda_tegra_remove(struct platform_device *pdev) return snd_card_free(dev_get_drvdata(&pdev->dev)); } +static void hda_tegra_shutdown(struct platform_device *pdev) +{ + struct snd_card *card = dev_get_drvdata(&pdev->dev); + struct azx *chip; + + if (!card) + return; + chip = card->private_data; + if (chip && chip->running) + azx_stop_chip(chip); +} + static struct platform_driver tegra_platform_hda = { .driver = { .name = "tegra-hda", @@ -525,6 +534,7 @@ static struct platform_driver tegra_platform_hda = { }, .probe = hda_tegra_probe, .remove = hda_tegra_remove, + .shutdown = hda_tegra_shutdown, }; module_platform_driver(tegra_platform_hda); |