[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e8165e99-9770-4287-8a05-709a9a7bb701@roeck-us.net>
Date: Tue, 10 Dec 2024 07:22:21 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Ming Yu <a0282524688@...il.com>, tmyu0@...oton.com, lee@...nel.org,
linus.walleij@...aro.org, brgl@...ev.pl, andi.shyti@...nel.org,
mkl@...gutronix.de, mailhol.vincent@...adoo.fr, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, wim@...ux-watchdog.org, jdelvare@...e.com,
alexandre.belloni@...tlin.com
Cc: linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-i2c@...r.kernel.org, linux-can@...r.kernel.org,
netdev@...r.kernel.org, linux-watchdog@...r.kernel.org,
linux-hwmon@...r.kernel.org, linux-rtc@...r.kernel.org
Subject: Re: [PATCH v3 5/7] watchdog: Add Nuvoton NCT6694 WDT support
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@...oton.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
Powered by blists - more mailing lists