summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_intel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-03-05 17:21:32 +0100
committerTakashi Iwai <tiwai@suse.de>2015-03-13 15:28:58 +0100
commitb2a0bafa758256442e04d1f34d6d0746b846d23d (patch)
tree97f3ada5d1e4aced0254f856bf819bc9dca57b89 /sound/pci/hda/hda_intel.c
parentd56db741b8e688a0b9d4d5bb9caa11dfcb7c0b08 (diff)
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_intel.c')
-rw-r--r--sound/pci/hda/hda_intel.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index dbc5a593da46..25668fde8480 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1066,8 +1066,6 @@ static int azx_free(struct azx *chip)
azx_del_card_list(chip);
- azx_notifier_unregister(chip);
-
hda->init_failed = 1; /* to be sure */
complete_all(&hda->probe_wait);
@@ -1900,7 +1898,6 @@ static int azx_probe_continue(struct azx *chip)
goto out_free;
chip->running = 1;
- azx_notifier_register(chip);
azx_add_card_list(chip);
snd_hda_set_power_save(chip->bus, power_save * 1000);
if (azx_has_pm_runtime(chip) || hda->use_vga_switcheroo)
@@ -1921,6 +1918,18 @@ static void azx_remove(struct pci_dev *pci)
snd_card_free(card);
}
+static void azx_shutdown(struct pci_dev *pci)
+{
+ struct snd_card *card = pci_get_drvdata(pci);
+ struct azx *chip;
+
+ if (!card)
+ return;
+ chip = card->private_data;
+ if (chip && chip->running)
+ azx_stop_chip(chip);
+}
+
/* PCI IDs */
static const struct pci_device_id azx_ids[] = {
/* CPT */
@@ -2143,6 +2152,7 @@ static struct pci_driver azx_driver = {
.id_table = azx_ids,
.probe = azx_probe,
.remove = azx_remove,
+ .shutdown = azx_shutdown,
.driver = {
.pm = AZX_PM_OPS,
},