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

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

From: Ming Yu <hidden>
Date: 2024-12-12 06:26:54
Also in: linux-can, linux-gpio, linux-hwmon, linux-i2c, linux-rtc, linux-watchdog, lkml

Dear Guenter,

Thank you for your comments,

Guenter Roeck [off-list ref] 於 2024年12月10日 週二 下午11:22寫道:
quoted
+static int nct6694_wdt_probe(struct platform_device *pdev)
+{
...
quoted
+     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.
Understood! I will drop it in v4.

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