All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH Resend 1/2] pwm: atmel: Remove redundant of_match_ptr helper
@ 2014-01-23 10:58 Sachin Kamat
  2014-01-23 10:58 ` [PATCH Resend 2/2] pwm: pxa: Use " Sachin Kamat
  2014-01-23 12:44 ` [PATCH Resend 1/2] pwm: atmel: Remove redundant " Thierry Reding
  0 siblings, 2 replies; 6+ messages in thread
From: Sachin Kamat @ 2014-01-23 10:58 UTC (permalink / raw)
  To: linux-pwm; +Cc: thierry.reding, sachin.kamat

'atmel_pwm_dt_ids' is always compiled in. Hence the
helper macro is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/pwm/pwm-atmel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
index bf4144a14661..45f0fb793528 100644
--- a/drivers/pwm/pwm-atmel.c
+++ b/drivers/pwm/pwm-atmel.c
@@ -381,7 +381,7 @@ static int atmel_pwm_remove(struct platform_device *pdev)
 static struct platform_driver atmel_pwm_driver = {
 	.driver = {
 		.name = "atmel-pwm",
-		.of_match_table = of_match_ptr(atmel_pwm_dt_ids),
+		.of_match_table = atmel_pwm_dt_ids,
 	},
 	.id_table = atmel_pwm_devtypes,
 	.probe = atmel_pwm_probe,
-- 
1.7.9.5


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

* [PATCH Resend 2/2] pwm: pxa: Use of_match_ptr helper
  2014-01-23 10:58 [PATCH Resend 1/2] pwm: atmel: Remove redundant of_match_ptr helper Sachin Kamat
@ 2014-01-23 10:58 ` Sachin Kamat
  2014-01-23 12:48   ` Thierry Reding
  2014-01-23 12:44 ` [PATCH Resend 1/2] pwm: atmel: Remove redundant " Thierry Reding
  1 sibling, 1 reply; 6+ messages in thread
From: Sachin Kamat @ 2014-01-23 10:58 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 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);
 
 	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] 6+ messages in thread

* Re: [PATCH Resend 1/2] pwm: atmel: Remove redundant of_match_ptr helper
  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:44 ` Thierry Reding
  2014-01-24  9:04   ` Sachin Kamat
  1 sibling, 1 reply; 6+ messages in thread
From: Thierry Reding @ 2014-01-23 12:44 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-pwm

[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]

On Thu, Jan 23, 2014 at 04:28:34PM +0530, Sachin Kamat wrote:
> 'atmel_pwm_dt_ids' is always compiled in. Hence the
> helper macro is not needed.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/pwm/pwm-atmel.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Hi Sachin,

Sorry for taking so long to look at this, things have been pretty
busy...

> diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
> index bf4144a14661..45f0fb793528 100644
> --- a/drivers/pwm/pwm-atmel.c
> +++ b/drivers/pwm/pwm-atmel.c
> @@ -381,7 +381,7 @@ static int atmel_pwm_remove(struct platform_device *pdev)
>  static struct platform_driver atmel_pwm_driver = {
>  	.driver = {
>  		.name = "atmel-pwm",
> -		.of_match_table = of_match_ptr(atmel_pwm_dt_ids),
> +		.of_match_table = atmel_pwm_dt_ids,
>  	},
>  	.id_table = atmel_pwm_devtypes,
>  	.probe = atmel_pwm_probe,

Given that the driver doesn't depend on OF, I think the right thing to
do here would be to #ifdef the atmel_pwm_dt_ids so it doesn't waste
needless memory.

See also my comment to patch 2/2 that I'm about to send out.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH Resend 2/2] pwm: pxa: Use of_match_ptr helper
  2014-01-23 10:58 ` [PATCH Resend 2/2] pwm: pxa: Use " Sachin Kamat
@ 2014-01-23 12:48   ` Thierry Reding
  2014-01-24  9:05     ` Sachin Kamat
  0 siblings, 1 reply; 6+ messages in thread
From: Thierry Reding @ 2014-01-23 12:48 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-pwm

[-- 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 --]

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

* Re: [PATCH Resend 1/2] pwm: atmel: Remove redundant of_match_ptr helper
  2014-01-23 12:44 ` [PATCH Resend 1/2] pwm: atmel: Remove redundant " Thierry Reding
@ 2014-01-24  9:04   ` Sachin Kamat
  0 siblings, 0 replies; 6+ messages in thread
From: Sachin Kamat @ 2014-01-24  9:04 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-pwm

Hi Thierry,

On 23 January 2014 18:14, Thierry Reding <thierry.reding@gmail.com> wrote:
> On Thu, Jan 23, 2014 at 04:28:34PM +0530, Sachin Kamat wrote:
>> 'atmel_pwm_dt_ids' is always compiled in. Hence the
>> helper macro is not needed.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> ---
>>  drivers/pwm/pwm-atmel.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Hi Sachin,
>
> Sorry for taking so long to look at this, things have been pretty
> busy...

No problem. Sorry to bother you though.

>
>> diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
>> index bf4144a14661..45f0fb793528 100644
>> --- a/drivers/pwm/pwm-atmel.c
>> +++ b/drivers/pwm/pwm-atmel.c
>> @@ -381,7 +381,7 @@ static int atmel_pwm_remove(struct platform_device *pdev)
>>  static struct platform_driver atmel_pwm_driver = {
>>       .driver = {
>>               .name = "atmel-pwm",
>> -             .of_match_table = of_match_ptr(atmel_pwm_dt_ids),
>> +             .of_match_table = atmel_pwm_dt_ids,
>>       },
>>       .id_table = atmel_pwm_devtypes,
>>       .probe = atmel_pwm_probe,
>
> Given that the driver doesn't depend on OF, I think the right thing to
> do here would be to #ifdef the atmel_pwm_dt_ids so it doesn't waste
> needless memory.

OK. Will update accordingly.


-- 
With warm regards,
Sachin

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

* Re: [PATCH Resend 2/2] pwm: pxa: Use of_match_ptr helper
  2014-01-23 12:48   ` Thierry Reding
@ 2014-01-24  9:05     ` Sachin Kamat
  0 siblings, 0 replies; 6+ messages in thread
From: Sachin Kamat @ 2014-01-24  9:05 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-pwm

On 23 January 2014 18:18, Thierry Reding <thierry.reding@gmail.com> wrote:
> 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.

OK. If you prefer so, will drop this patch then.



-- 
With warm regards,
Sachin

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

end of thread, other threads:[~2014-01-24  9:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.