From: Thierry Reding <thierry.reding@gmail.com>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: linux-pwm@vger.kernel.org
Subject: Re: [PATCH Resend 2/2] pwm: pxa: Use of_match_ptr helper
Date: Thu, 23 Jan 2014 13:48:00 +0100 [thread overview]
Message-ID: <20140123124759.GB28527@ulmo.nvidia.com> (raw)
In-Reply-To: <1390474715-6587-2-git-send-email-sachin.kamat@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 1213 bytes --]
On Thu, Jan 23, 2014 at 04:28:35PM +0530, Sachin Kamat wrote:
> Use the helper instead of defining NULL for CONFIG_OF
> disabled case.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/pwm/pwm-pxa.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
> index 8d995731cef8..685ae2c96b77 100644
> --- a/drivers/pwm/pwm-pxa.c
> +++ b/drivers/pwm/pwm-pxa.c
> @@ -19,6 +19,7 @@
> #include <linux/clk.h>
> #include <linux/io.h>
> #include <linux/pwm.h>
> +#include <linux/of.h>
> #include <linux/of_device.h>
>
> #include <asm/div64.h>
> @@ -140,13 +141,12 @@ static struct of_device_id pwm_of_match[] = {
> { }
> };
> MODULE_DEVICE_TABLE(of, pwm_of_match);
> -#else
> -#define pwm_of_match NULL
> #endif
>
> static const struct platform_device_id *pxa_pwm_get_id_dt(struct device *dev)
> {
> - const struct of_device_id *id = of_match_device(pwm_of_match, dev);
> + const struct of_device_id *id;
> + id = of_match_device(of_match_ptr(pwm_of_match), dev);
Because of this, I find it actually more elegant to define pwm_of_match
to NULL for non-DT.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-01-23 12:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-23 10:58 [PATCH Resend 1/2] pwm: atmel: Remove redundant of_match_ptr helper Sachin Kamat
2014-01-23 10:58 ` [PATCH Resend 2/2] pwm: pxa: Use " Sachin Kamat
2014-01-23 12:48 ` Thierry Reding [this message]
2014-01-24 9:05 ` Sachin Kamat
2014-01-23 12:44 ` [PATCH Resend 1/2] pwm: atmel: Remove redundant " Thierry Reding
2014-01-24 9:04 ` Sachin Kamat
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=20140123124759.GB28527@ulmo.nvidia.com \
--to=thierry.reding@gmail.com \
--cc=linux-pwm@vger.kernel.org \
--cc=sachin.kamat@linaro.org \
/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.