Message ID | 20241210104524.2466586-1-tmyu0@nuvoton.com |
---|---|
Headers | show |
Series | Add Nuvoton NCT6694 MFD drivers | expand |
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
On Tue, 10 Dec 2024 11:57:41 +0100 Mateusz Polchlopek wrote: > > +int nct6694_read_msg(struct nct6694 *nct6694, u8 mod, u16 offset, > > + u16 length, void *buf) > > +{ > > + struct nct6694_cmd_header *cmd_header = nct6694->cmd_header; > > + struct nct6694_response_header *response_header = nct6694->response_header; > > RCT violation This code is not under net not drivers/net As a general rule please focus on functional review, formatting and process issues are harder to judge unless you read all of the mailing list traffic.
On 12/11/2024 2:56 AM, Jakub Kicinski wrote: > On Tue, 10 Dec 2024 11:57:41 +0100 Mateusz Polchlopek wrote: >>> +int nct6694_read_msg(struct nct6694 *nct6694, u8 mod, u16 offset, >>> + u16 length, void *buf) >>> +{ >>> + struct nct6694_cmd_header *cmd_header = nct6694->cmd_header; >>> + struct nct6694_response_header *response_header = nct6694->response_header; >> >> RCT violation > > This code is not under net not drivers/net > As a general rule please focus on functional review, formatting and > process issues are harder to judge unless you read all of the mailing > list traffic. Okay, my bad. Thanks Kuba for explanation and I will focus on code next time
Dear Guenter, Thank you for your comments, Guenter Roeck <linux@roeck-us.net> 於 2024年12月10日 週二 下午11:22寫道: > > > +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. > Understood! I will drop it in v4. Best regards, Ming