From b2a0bafa758256442e04d1f34d6d0746b846d23d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 5 Mar 2015 17:21:32 +0100 Subject: 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 --- sound/pci/hda/hda_bind.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sound/pci/hda/hda_bind.c') 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 #include #include +#include #include #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); } -- cgit v1.2.3