linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] pwm: pxa: Use of_match_ptr helper
@ 2013-12-21  7:50 Sachin Kamat
  2014-01-13  3:09 ` Sachin Kamat
  0 siblings, 1 reply; 2+ messages in thread
From: Sachin Kamat @ 2013-12-21  7:50 UTC (permalink / raw)
  To: linux-pwm; +Cc: thierry.reding, sachin.kamat

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 3dc7c10bb7a0..5d25e4217542 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);
 
 	return id ? id->data : NULL;
 }
@@ -228,7 +228,7 @@ static struct platform_driver pwm_driver = {
 	.driver		= {
 		.name	= "pxa25x-pwm",
 		.owner	= THIS_MODULE,
-		.of_match_table = pwm_of_match,
+		.of_match_table = of_match_ptr(pwm_of_match),
 	},
 	.probe		= pwm_probe,
 	.remove		= pwm_remove,
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] pwm: pxa: Use of_match_ptr helper
  2013-12-21  7:50 [PATCH 1/1] pwm: pxa: Use of_match_ptr helper Sachin Kamat
@ 2014-01-13  3:09 ` Sachin Kamat
  0 siblings, 0 replies; 2+ messages in thread
From: Sachin Kamat @ 2014-01-13  3:09 UTC (permalink / raw)
  To: linux-pwm; +Cc: Thierry Reding, Sachin Kamat

On 21 December 2013 13:20, Sachin Kamat <sachin.kamat@linaro.org> 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 3dc7c10bb7a0..5d25e4217542 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);
>
>         return id ? id->data : NULL;
>  }
> @@ -228,7 +228,7 @@ static struct platform_driver pwm_driver = {
>         .driver         = {
>                 .name   = "pxa25x-pwm",
>                 .owner  = THIS_MODULE,
> -               .of_match_table = pwm_of_match,
> +               .of_match_table = of_match_ptr(pwm_of_match),
>         },
>         .probe          = pwm_probe,
>         .remove         = pwm_remove,
> --
> 1.7.9.5
>

Gentle ping.

-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-13  3:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-21  7:50 [PATCH 1/1] pwm: pxa: Use of_match_ptr helper Sachin Kamat
2014-01-13  3:09 ` Sachin Kamat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).