diff mbox

[1/2] thermal: db8500: Use of_match_ptr() macro in db8500_thermal.c

Message ID 1355907059-28720-1-git-send-email-sachin.kamat@linaro.org
State Accepted
Headers show

Commit Message

Sachin Kamat Dec. 19, 2012, 8:50 a.m. UTC
This eliminates having an #ifdef returning NULL for the case
when OF is disabled.

Cc: Hongbo Zhang <hongbo.zhang@stericsson.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
Compile tested on linux-next.
---
 drivers/thermal/db8500_thermal.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

Comments

Hongbo Zhang Jan. 3, 2013, 9:05 a.m. UTC | #1
On 19 December 2012 16:50, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> This eliminates having an #ifdef returning NULL for the case
> when OF is disabled.
>
> Cc: Hongbo Zhang <hongbo.zhang@stericsson.com>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> Compile tested on linux-next.
> ---
>  drivers/thermal/db8500_thermal.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c
> index ec71ade..61ce60a 100644
> --- a/drivers/thermal/db8500_thermal.c
> +++ b/drivers/thermal/db8500_thermal.c
> @@ -508,15 +508,13 @@ static const struct of_device_id db8500_thermal_match[] = {
>         { .compatible = "stericsson,db8500-thermal" },
>         {},
>  };
> -#else
> -#define db8500_thermal_match NULL
>  #endif
>
>  static struct platform_driver db8500_thermal_driver = {
>         .driver = {
>                 .owner = THIS_MODULE,
>                 .name = "db8500-thermal",
> -               .of_match_table = db8500_thermal_match,
> +               .of_match_table = of_match_ptr(db8500_thermal_match),
>         },
>         .probe = db8500_thermal_probe,
>         .suspend = db8500_thermal_suspend,
> --
> 1.7.4.1
>
Good one.
Reviewed-by: hongbo.zhang@linaro.org
Zhang, Rui Jan. 4, 2013, 7:36 a.m. UTC | #2
On Wed, 2012-12-19 at 14:20 +0530, Sachin Kamat wrote:
> This eliminates having an #ifdef returning NULL for the case
> when OF is disabled.
> 
> Cc: Hongbo Zhang <hongbo.zhang@stericsson.com>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

applied to thermal-next.

thanks,
rui

> ---
> Compile tested on linux-next.
> ---
>  drivers/thermal/db8500_thermal.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c
> index ec71ade..61ce60a 100644
> --- a/drivers/thermal/db8500_thermal.c
> +++ b/drivers/thermal/db8500_thermal.c
> @@ -508,15 +508,13 @@ static const struct of_device_id db8500_thermal_match[] = {
>  	{ .compatible = "stericsson,db8500-thermal" },
>  	{},
>  };
> -#else
> -#define db8500_thermal_match NULL
>  #endif
>  
>  static struct platform_driver db8500_thermal_driver = {
>  	.driver = {
>  		.owner = THIS_MODULE,
>  		.name = "db8500-thermal",
> -		.of_match_table = db8500_thermal_match,
> +		.of_match_table = of_match_ptr(db8500_thermal_match),
>  	},
>  	.probe = db8500_thermal_probe,
>  	.suspend = db8500_thermal_suspend,
diff mbox

Patch

diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c
index ec71ade..61ce60a 100644
--- a/drivers/thermal/db8500_thermal.c
+++ b/drivers/thermal/db8500_thermal.c
@@ -508,15 +508,13 @@  static const struct of_device_id db8500_thermal_match[] = {
 	{ .compatible = "stericsson,db8500-thermal" },
 	{},
 };
-#else
-#define db8500_thermal_match NULL
 #endif
 
 static struct platform_driver db8500_thermal_driver = {
 	.driver = {
 		.owner = THIS_MODULE,
 		.name = "db8500-thermal",
-		.of_match_table = db8500_thermal_match,
+		.of_match_table = of_match_ptr(db8500_thermal_match),
 	},
 	.probe = db8500_thermal_probe,
 	.suspend = db8500_thermal_suspend,