Thread (26 messages) 26 messages, 5 authors, 2025-04-08

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

From: Ming Yu <hidden>
Date: 2025-02-12 02:27:45
Also in: linux-can, linux-gpio, linux-hwmon, linux-i2c, linux-rtc, linux-usb, linux-watchdog, lkml

Dear Christophe,

Thank you for reviewing,

Christophe JAILLET [off-list ref] 於 2025年2月8日 週六 上午4:30寫道:
Le 07/02/2025 à 08:45, Ming Yu a écrit :
quoted
This driver supports Watchdog timer functionality for NCT6694 MFD
device based on USB interface.
...
quoted
+static int nct6694_wdt_probe(struct platform_device *pdev)
+{
+     const struct mfd_cell *cell = mfd_get_cell(pdev);
+     struct device *dev = &pdev->dev;
+     struct nct6694 *nct6694 = dev_get_drvdata(pdev->dev.parent);
+     struct nct6694_wdt_data *data;
+     struct watchdog_device *wdev;
+
+     data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+     if (!data)
+             return -ENOMEM;
+
+     data->msg = devm_kzalloc(dev, sizeof(union nct6694_wdt_msg),
+                              GFP_KERNEL);
+     if (!data->msg)
+             return -ENOMEM;
+
+     data->dev = dev;
+     data->nct6694 = nct6694;
+     data->wdev_idx = cell->id;
+
+     wdev = &data->wdev;
+     wdev->info = &nct6694_wdt_info;
+     wdev->ops = &nct6694_wdt_ops;
+     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;
+
+     devm_mutex_init(dev, &data->lock);
Error handling?
(also apply for patch 1/7 and 6/7)
I will add error handling for these in the next patch.


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