From: Jerry Hoemann Date: Fri, 17 May 2019 20:59:38 +0000 (-0600) Subject: watchdog/hpwdt: Stop hpwdt on unregister. X-Git-Tag: v5.3-rc1~46^2~25 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=48b32199f97ad2ac23ef4a5b64f2d1bc0aec444f;p=linux.git watchdog/hpwdt: Stop hpwdt on unregister. Have the WD core stop the watchdog on unregister instead of explicitly calling hpwdt_stop() in hpwdt_exit(). Signed-off-by: Jerry Hoemann Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index f7b5242b9c85..b2cba8851cf2 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -306,6 +306,7 @@ static int hpwdt_init_one(struct pci_dev *dev, if (retval != 0) goto error_init_nmi_decoding; + watchdog_stop_on_unregister(&hpwdt_dev); watchdog_set_nowayout(&hpwdt_dev, nowayout); watchdog_init_timeout(&hpwdt_dev, soft_margin, NULL); @@ -343,9 +344,6 @@ static int hpwdt_init_one(struct pci_dev *dev, static void hpwdt_exit(struct pci_dev *dev) { - if (!nowayout) - hpwdt_stop(); - watchdog_unregister_device(&hpwdt_dev); hpwdt_exit_nmi_decoding(); pci_iounmap(dev, pci_mem_addr);