From db86a8e35df85c0cd38a9895f96b6555e9ccdba3 Mon Sep 17 00:00:00 2001 From: Wang Wensheng Date: Mon, 22 Feb 2021 10:57:36 +0800 Subject: [PATCH] sbsa_gwdt: Add WDIOF_PRETIMEOUT flag to watchdog_info at defination ascend inclusion category: bugfix bugzilla: NA ------------------- This flag is used by watchdog-core to determine the visibility of the attributes associated with pretimout when the watchdog-core probes the device. If we set the flag after that process those attributes could not be create properly. Fixes: 569f7c7750c1 ("sbsa_gwdt: Introduce a panic notifier") Signed-off-by: Wang Wensheng Reviewed-by: Xiongfeng Wang Signed-off-by: Yang Yingliang Signed-off-by: Cheng Jian --- drivers/watchdog/sbsa_gwdt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c index 00723fb9e4ca..8045a66cdb69 100644 --- a/drivers/watchdog/sbsa_gwdt.c +++ b/drivers/watchdog/sbsa_gwdt.c @@ -214,11 +214,14 @@ static irqreturn_t sbsa_gwdt_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct watchdog_info sbsa_gwdt_info = { +static const struct watchdog_info sbsa_gwdt_info = { .identity = WATCHDOG_NAME, .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE | +#ifdef CONFIG_ARM_SBSA_WATCHDOG_PANIC_NOTIFIER + WDIOF_PRETIMEOUT | +#endif WDIOF_CARDRESET, }; @@ -369,7 +372,6 @@ static int sbsa_gwdt_probe(struct platform_device *pdev) * Add WDIOF_PRETIMEOUT flags to enable user to configure it. */ gwdt->wdd.pretimeout = gwdt->wdd.timeout - 1; - sbsa_gwdt_info.options |= WDIOF_PRETIMEOUT; sbsa_register_panic_notifier(gwdt); } -- GitLab