[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27bafe2b-6fc0-2e5c-8c4e-99ed74caa5d6@roeck-us.net>
Date: Fri, 7 Apr 2023 05:46:47 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Keguang Zhang <keguang.zhang@...il.com>,
linux-watchdog@...r.kernel.org, devicetree@...r.kernel.org,
linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Wim Van Sebroeck <wim@...ux-watchdog.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Yang Ling <gnaygnil@...il.com>
Subject: Re: [PATCH 2/2] watchdog: loongson1_wdt: Add DT support
On 4/7/23 04:00, Keguang Zhang wrote:
> This patch adds the of_match_table to enable DT support
> of Loongson-1 watchdog driver.
> And modify the parameter of devm_clk_get() accordingly.
>
> Signed-off-by: Keguang Zhang <keguang.zhang@...il.com>
> ---
> drivers/watchdog/loongson1_wdt.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/loongson1_wdt.c b/drivers/watchdog/loongson1_wdt.c
> index bb3d075c0633..c2694222ea86 100644
> --- a/drivers/watchdog/loongson1_wdt.c
> +++ b/drivers/watchdog/loongson1_wdt.c
> @@ -5,6 +5,7 @@
>
> #include <linux/clk.h>
> #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
> #include <linux/platform_device.h>
> #include <linux/watchdog.h>
> #include <loongson1.h>
> @@ -100,7 +101,7 @@ static int ls1x_wdt_probe(struct platform_device *pdev)
> if (IS_ERR(drvdata->base))
> return PTR_ERR(drvdata->base);
>
> - drvdata->clk = devm_clk_get(dev, pdev->name);
> + drvdata->clk = devm_clk_get(dev, NULL);
> if (IS_ERR(drvdata->clk))
> return PTR_ERR(drvdata->clk);
>
> @@ -142,10 +143,19 @@ static int ls1x_wdt_probe(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id ls1x_wdt_dt_ids[] = {
> + { .compatible = "loongson,ls1x-wdt", },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, ls1x_wdt_dt_ids);
> +#endif
> +
> static struct platform_driver ls1x_wdt_driver = {
> .probe = ls1x_wdt_probe,
> .driver = {
> .name = "ls1x-wdt",
> + .of_match_table = ls1x_wdt_dt_ids,
If CONFIG_OF=n, this would result in a missing symbol.
Guenter
Powered by blists - more mailing lists