Thread (39 messages) 39 messages, 12 authors, 2024-12-26

Re: [PATCH v3 5/7] watchdog: Add Nuvoton NCT6694 WDT support

From: Guenter Roeck <linux@roeck-us.net>
Date: 2024-12-10 15:22:26
Also in: linux-can, linux-gpio, linux-hwmon, linux-i2c, linux-rtc, linux-watchdog, lkml

On 12/10/24 02:45, Ming Yu wrote:
This driver supports Watchdog timer functionality for NCT6694 MFD
device based on USB interface.

Signed-off-by: Ming Yu <tmyu0@nuvoton.com>
---
...
+static int nct6694_wdt_probe(struct platform_device *pdev)
+{
...
+	wdev->timeout = timeout;
+	wdev->pretimeout = pretimeout;
+	if (timeout < pretimeout) {
+		dev_warn(data->dev, "pretimeout < timeout. Setting to zero\n");
+		wdev->pretimeout = 0;
+	}
+
+	wdev->min_timeout = 1;
+	wdev->max_timeout = 255;
+
+	mutex_init(&data->lock);
+
+	platform_set_drvdata(pdev, data);
+
+	/* Register watchdog timer device to WDT framework */
+	watchdog_set_drvdata(&data->wdev, data);
+	watchdog_init_timeout(&data->wdev, timeout, dev);
This is pointless since timeout is pre-initialized with a value != 0.
That means a value provided through devicetree will never be used
unless the user sets timeout=0 as module parameter. But then the above
check for pretimeout is useless.

Guenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help