summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_bind.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_bind.c
parentALSA: hda - Release resources in device release callback (diff)
downloadlinux-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_bind.c')
-rw-r--r--sound/pci/hda/hda_bind.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_bind.c b/sound/pci/hda/hda_bind.c
index a49bc45c2ea5..1f40ce3c1696 100644
--- a/sound/pci/hda/hda_bind.c
+++ b/sound/pci/hda/hda_bind.c
@@ -9,6 +9,7 @@
#include <linux/module.h>
#include <linux/export.h>
#include <linux/pm.h>
+#include <linux/pm_runtime.h>
#include <sound/core.h>
#include "hda_codec.h"
#include "hda_local.h"
@@ -142,6 +143,14 @@ static int hda_codec_driver_remove(struct device *dev)
return 0;
}
+static void hda_codec_driver_shutdown(struct device *dev)
+{
+ struct hda_codec *codec = dev_to_hda_codec(dev);
+
+ if (!pm_runtime_suspended(dev) && codec->patch_ops.reboot_notify)
+ codec->patch_ops.reboot_notify(codec);
+}
+
int __hda_codec_driver_register(struct hda_codec_driver *drv, const char *name,
struct module *owner)
{
@@ -150,6 +159,7 @@ int __hda_codec_driver_register(struct hda_codec_driver *drv, const char *name,
drv->driver.bus = &snd_hda_bus_type;
drv->driver.probe = hda_codec_driver_probe;
drv->driver.remove = hda_codec_driver_remove;
+ drv->driver.shutdown = hda_codec_driver_shutdown;
drv->driver.pm = &hda_codec_driver_pm;
return driver_register(&drv->driver);
}