From: Jerry Hoemann Date: Wed, 8 Aug 2018 19:13:23 +0000 (-0600) Subject: watchdog: hpwdt: Initialize pretimeout from module parameter. X-Git-Tag: v4.20-rc1~87^2~29 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4d9186d01e7a6af1c02fcb639632fb97a8e140a6;p=users%2Fjedix%2Flinux-maple.git watchdog: hpwdt: Initialize pretimeout from module parameter. When the pretimeout is specified as a module parameter, the value should be reflected in hpwdt_dev.pretimeout. The default (on) case is correct. But, when disabling pretimeout, the value should be set to zero in hpwdt_dev. When compiling w/o CONFIG_HPWDT_NMI_DECODING defined, the pretimeout module parameter is ignored and the value internally will be 0. 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 9dc62a4614512..fae93643beaba 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -205,9 +205,7 @@ static struct watchdog_device hpwdt_dev = { .min_timeout = 1, .max_timeout = HPWDT_MAX_TIMER, .timeout = DEFAULT_MARGIN, -#ifdef CONFIG_HPWDT_NMI_DECODING .pretimeout = PRETIMEOUT_SEC, -#endif }; @@ -313,6 +311,8 @@ static int hpwdt_init_one(struct pci_dev *dev, if (watchdog_init_timeout(&hpwdt_dev, soft_margin, NULL)) dev_warn(&dev->dev, "Invalid soft_margin: %d.\n", soft_margin); + hpwdt_dev.pretimeout = pretimeout ? PRETIMEOUT_SEC : 0; + hpwdt_dev.parent = &dev->dev; retval = watchdog_register_device(&hpwdt_dev); if (retval < 0) {