Re: [PATCH v3 2/6] watchdog: w83627hf_wdt: Convert to platform driver model
From: Tzung-Bi Shih
Date: Tue Oct 06 2026 - 10:25:02 EST
On Sun, Oct 04, 2026 at 02:12:50PM +0200, Paul Louvel wrote:
> @@ -29,6 +29,7 @@
>
> #include <linux/bits.h>
> #include <linux/module.h>
> +#include <linux/platform_device.h>
> #include <linux/moduleparam.h>
> #include <linux/types.h>
> #include <linux/watchdog.h>
Keep it sorted.
> +static int wdt_probe(struct platform_device *pdev)
> +{
> + const struct platform_device_id *id = platform_get_device_id(pdev);
> + struct device *dev = &pdev->dev;
> + struct watchdog_device *wdd;
> + struct w83627hf_data *data;
> + enum chips chip;
> + int ret;
> +
> + dev_info(dev, "WDT driver initialising\n");
> +
> + if (!id)
> + return dev_err_probe(dev, -EINVAL, "failed to get chip id\n");
> +
> + chip = id->driver_data;
> +
> + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
^^^^^^^^^^
To be neat: `dev`.
> + ret = devm_watchdog_register_device(dev, wdd);
> + if (ret)
> + return ret;
> +
> + dev_info(dev, "initialized. timeout=%d sec (nowayout=%d)\n",
> + wdd->timeout, nowayout);
> +
> + return ret;
To be neat: `return 0;`
> +static const struct platform_device_id wdt_ids[] = {
> + { .name = "W83627HF", .driver_data = w83627hf },
...
> + {},
This is the sentinel; the last comma can/should be dropped.