All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: dinguyen@altera.com
Cc: dinh.linux@gmail.com, Jamie Iles <jamie@jamieiles.com>,
	Viresh Kumar <viresh.linux@gmail.com>,
	Wim Van Sebroeck <wim@iguana.be>, Pavel Machek <pavel@denx.de>,
	Rob Herring <rob.herring@calxeda.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Ian Campbell <ian.campbell@citrix.com>,
	devicetree@vger.kernel.org, linux-watchdog@vger.kernel.org,
	Sachin Kamat <sachin.kamat@linaro.org>
Subject: Re: [RESEND PATCHv2] watchdog: dw: Enable OF support for DW watchdog timer.
Date: Wed, 2 Oct 2013 12:27:43 -0700	[thread overview]
Message-ID: <20131002192743.GA4695@roeck-us.net> (raw)
In-Reply-To: <1380739472-26172-1-git-send-email-dinguyen@altera.com>

On Wed, Oct 02, 2013 at 01:44:32PM -0500, dinguyen@altera.com wrote:
> From: Dinh Nguyen <dinguyen@altera.com>
> 
> Add device tree support to the DW watchdog timer.
> 
> Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
> Acked-by: Jamie Iles <jamie@jamieiles.com>
> Reviewed-by: Pavel Machek <pavel@denx.de>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Jamie Iles <jamie@jamieiles.com>
> Cc: Viresh Kumar <viresh.linux@gmail.com>
> Cc: Wim Van Sebroeck <wim@iguana.be>
> Cc: Pavel Machek <pavel@denx.de>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Pawel Moll <pawel.moll@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: devicetree@vger.kernel.org
> Cc: linux-watchdog@vger.kernel.org
> ---
> v2:
> - Use of_match_ptr() for of_match_table
> ---
>  .../devicetree/bindings/watchdog/dw_wdt.txt        |   16 ++++++++++++++++
>  drivers/watchdog/dw_wdt.c                          |    8 ++++++++
>  2 files changed, 24 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/watchdog/dw_wdt.txt
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/dw_wdt.txt b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt
> new file mode 100644
> index 0000000..29e150b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt
> @@ -0,0 +1,16 @@
> +Synopsys Designware Watchdog Timer
> +
> +Required Properties:
> +
> +- Compatiblity	: "snps,dw-wdt"
> +- reg		: Base address of the watchdog timer register.
> +
> +Example:
> +
> +	watchdog0: wd@ffd02000 {
> +		compatible = "snps,dw-wdt";
> +		reg = <0xffd02000 0x1000>;
> +		interrupts = <0 171 4>;
> +		clocks = <&per_base_clk>;
> +		status = "okay";
> +	};
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> index 2037669..a720f9b 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -29,6 +29,7 @@
>  #include <linux/miscdevice.h>
>  #include <linux/module.h>
>  #include <linux/moduleparam.h>
> +#include <linux/of.h>
>  #include <linux/pm.h>
>  #include <linux/platform_device.h>
>  #include <linux/spinlock.h>
> @@ -343,12 +344,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 = of_match_ptr(dw_wdt_of_match),

There is a separate set of patches from Sachin, removing unnecessary
uses of of_match_ptr() from various watchdog drivers. Sachin's argument
is that it does not make sense to use of_match_ptr if the function
it points to (dw_wdt_of_match in this case) is always compiled
unconditionally anyway.

Your comments suggest that you actually _added_ of_match_ptr() in v2 of this
patch, even though dw_wdt_of_match always exists and of_match_ptr is thus
technically unnecessary.

Not that I really care one way or another, but can we get an authoritative
answer what subsystem maintainers are supposed to accept ?

Thanks,
Guenter

>  #ifdef CONFIG_PM
>  		.pm	= &dw_wdt_pm_ops,
>  #endif /* CONFIG_PM */
> -- 
> 1.7.9.5
> 
> 
> 

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
To: dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org
Cc: dinh.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Jamie Iles <jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>,
	Viresh Kumar
	<viresh.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Wim Van Sebroeck <wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org>,
	Pavel Machek <pavel-ynQEQJNshbs@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Ian Campbell
	<ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Sachin Kamat
	<sachin.kamat-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [RESEND PATCHv2] watchdog: dw: Enable OF support for DW watchdog timer.
Date: Wed, 2 Oct 2013 12:27:43 -0700	[thread overview]
Message-ID: <20131002192743.GA4695@roeck-us.net> (raw)
In-Reply-To: <1380739472-26172-1-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>

On Wed, Oct 02, 2013 at 01:44:32PM -0500, dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org wrote:
> From: Dinh Nguyen <dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
> 
> Add device tree support to the DW watchdog timer.
> 
> Signed-off-by: Dinh Nguyen <dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
> Acked-by: Jamie Iles <jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
> Reviewed-by: Pavel Machek <pavel-ynQEQJNshbs@public.gmane.org>
> Cc: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
> Cc: Jamie Iles <jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
> Cc: Viresh Kumar <viresh.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Wim Van Sebroeck <wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org>
> Cc: Pavel Machek <pavel-ynQEQJNshbs@public.gmane.org>
> Cc: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
> Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
> Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
> Cc: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
> Cc: Ian Campbell <ian.campbell-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> ---
> v2:
> - Use of_match_ptr() for of_match_table
> ---
>  .../devicetree/bindings/watchdog/dw_wdt.txt        |   16 ++++++++++++++++
>  drivers/watchdog/dw_wdt.c                          |    8 ++++++++
>  2 files changed, 24 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/watchdog/dw_wdt.txt
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/dw_wdt.txt b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt
> new file mode 100644
> index 0000000..29e150b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt
> @@ -0,0 +1,16 @@
> +Synopsys Designware Watchdog Timer
> +
> +Required Properties:
> +
> +- Compatiblity	: "snps,dw-wdt"
> +- reg		: Base address of the watchdog timer register.
> +
> +Example:
> +
> +	watchdog0: wd@ffd02000 {
> +		compatible = "snps,dw-wdt";
> +		reg = <0xffd02000 0x1000>;
> +		interrupts = <0 171 4>;
> +		clocks = <&per_base_clk>;
> +		status = "okay";
> +	};
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> index 2037669..a720f9b 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -29,6 +29,7 @@
>  #include <linux/miscdevice.h>
>  #include <linux/module.h>
>  #include <linux/moduleparam.h>
> +#include <linux/of.h>
>  #include <linux/pm.h>
>  #include <linux/platform_device.h>
>  #include <linux/spinlock.h>
> @@ -343,12 +344,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 = of_match_ptr(dw_wdt_of_match),

There is a separate set of patches from Sachin, removing unnecessary
uses of of_match_ptr() from various watchdog drivers. Sachin's argument
is that it does not make sense to use of_match_ptr if the function
it points to (dw_wdt_of_match in this case) is always compiled
unconditionally anyway.

Your comments suggest that you actually _added_ of_match_ptr() in v2 of this
patch, even though dw_wdt_of_match always exists and of_match_ptr is thus
technically unnecessary.

Not that I really care one way or another, but can we get an authoritative
answer what subsystem maintainers are supposed to accept ?

Thanks,
Guenter

>  #ifdef CONFIG_PM
>  		.pm	= &dw_wdt_pm_ops,
>  #endif /* CONFIG_PM */
> -- 
> 1.7.9.5
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-10-02 19:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02 18:44 [RESEND PATCHv2] watchdog: dw: Enable OF support for DW watchdog timer dinguyen
2013-10-02 18:44 ` dinguyen-EIB2kfCEclfQT0dZR+AlfA
2013-10-02 19:27 ` Guenter Roeck [this message]
2013-10-02 19:27   ` Guenter Roeck
2013-10-21 11:05 ` Mark Rutland
2013-10-21 11:05   ` Mark Rutland
2013-10-22  0:41   ` Guenter Roeck
2013-10-22  0:41     ` Guenter Roeck
2013-10-22 10:39     ` Mark Rutland
2013-10-22 10:39       ` Mark Rutland
2013-10-22 10:57       ` Dinh Nguyen
2013-10-22 10:57         ` Dinh Nguyen
2013-10-22 11:02         ` Mark Rutland
2013-10-22 11:02           ` Mark Rutland
2013-10-22 11:02         ` Jamie Iles
2013-10-22 11:02           ` Jamie Iles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131002192743.GA4695@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@altera.com \
    --cc=dinh.linux@gmail.com \
    --cc=ian.campbell@citrix.com \
    --cc=jamie@jamieiles.com \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pavel@denx.de \
    --cc=pawel.moll@arm.com \
    --cc=rob.herring@calxeda.com \
    --cc=sachin.kamat@linaro.org \
    --cc=swarren@wwwdotorg.org \
    --cc=viresh.linux@gmail.com \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.