[PATCH] watchdog: dw: Enable OF support for DW watchdog timer.

Jamie Iles jamie at jamieiles.com
Wed Jul 10 20:41:01 EST 2013


Hi Dinh,

On Tue, Jul 09, 2013 at 06:09:37PM -0500, dinguyen at altera.com wrote:
> From: Dinh Nguyen <dinguyen at altera.com>
> 
> Add device tree support to the DW watchdog timer.
> 
> Signed-off-by: Dinh Nguyen <dinguyen at altera.com>
> Cc: Jamie Iles <jamie at jamieiles.com>
> Cc: Viresh Kumar <viresh.kumar at st.com>
> Cc: Grant Likely <grant.likely at linaro.org>
> Cc: Rob Herring <rob.herring at calxeda.com>
> Cc: Wim Van Sebroeck <wim at iguana.be>
> Cc: Pavel Machek <pavel at denx.de>
> ---
>  .../devicetree/bindings/watchdog/dw_wdt.txt        |   16 ++++++++++++++++
>  drivers/watchdog/dw_wdt.c                          |    7 +++++++
>  2 files changed, 23 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/watchdog/dw_wdt.txt
>
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> index 2037669..f7eec38 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -343,12 +343,19 @@ static int dw_wdt_drv_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct of_device_id dw_wdt_of_match[] = {
> +	{ .compatible = "snps,dw-wdt", },
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, dw_wdt_of_match);
> +
>  static struct platform_driver dw_wdt_driver = {
>  	.probe		= dw_wdt_drv_probe,
>  	.remove		= dw_wdt_drv_remove,
>  	.driver		= {
>  		.name	= "dw_wdt",
>  		.owner	= THIS_MODULE,
> +		.of_match_table = dw_wdt_of_match,

I think we want:

		.of_match_table = of_match_ptr(dw_wdt_of_match),

as the module doesn't have an OF dependency.

Otherwise looks good to me.

Acked-by: Jamie Iles <jamie at jamieiles.com>

Thanks,

Jamie


More information about the devicetree-discuss mailing list