diff mbox

spi: spi-altera: Use of_match_ptr

Message ID 1345015828-8444-1-git-send-email-tklauser@distanz.ch (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Tobias Klauser Aug. 15, 2012, 7:30 a.m. UTC
Instead of having to define the match table to NULL if CONFIG_OF isn't
set, use the of_match_ptr() macro which will do this for us.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/spi/spi-altera.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

Comments

Rob Herring Aug. 15, 2012, 1:09 p.m. UTC | #1
On 08/15/2012 02:30 AM, Tobias Klauser wrote:
> Instead of having to define the match table to NULL if CONFIG_OF isn't
> set, use the of_match_ptr() macro which will do this for us.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Acked-by: Rob Herring <rob.herring@calxeda.com>

Adding Mark B. as he is helping Grant out with spi.

Rob

> ---
>  drivers/spi/spi-altera.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c
> index c00d00e..f1fec2a 100644
> --- a/drivers/spi/spi-altera.c
> +++ b/drivers/spi/spi-altera.c
> @@ -307,8 +307,6 @@ static const struct of_device_id altera_spi_match[] = {
>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, altera_spi_match);
> -#else /* CONFIG_OF */
> -#define altera_spi_match NULL
>  #endif /* CONFIG_OF */
>  
>  static struct platform_driver altera_spi_driver = {
> @@ -318,7 +316,7 @@ static struct platform_driver altera_spi_driver = {
>  		.name = DRV_NAME,
>  		.owner = THIS_MODULE,
>  		.pm = NULL,
> -		.of_match_table = altera_spi_match,
> +		.of_match_table = of_match_ptr(altera_spi_match),
>  	},
>  };
>  module_platform_driver(altera_spi_driver);
> 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Mark Brown Aug. 15, 2012, 2 p.m. UTC | #2
On Wed, Aug 15, 2012 at 08:09:07AM -0500, Rob Herring wrote:
> On 08/15/2012 02:30 AM, Tobias Klauser wrote:
> > Instead of having to define the match table to NULL if CONFIG_OF isn't
> > set, use the of_match_ptr() macro which will do this for us.
> > 
> > Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

> Acked-by: Rob Herring <rob.herring@calxeda.com>

> Adding Mark B. as he is helping Grant out with spi.

Please send me the patch directly (ie, not quoted).

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Mark Brown Aug. 15, 2012, 4:18 p.m. UTC | #3
On Wed, Aug 15, 2012 at 09:30:28AM +0200, Tobias Klauser wrote:
> Instead of having to define the match table to NULL if CONFIG_OF isn't
> set, use the of_match_ptr() macro which will do this for us.

Applied, thanks.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
diff mbox

Patch

diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c
index c00d00e..f1fec2a 100644
--- a/drivers/spi/spi-altera.c
+++ b/drivers/spi/spi-altera.c
@@ -307,8 +307,6 @@  static const struct of_device_id altera_spi_match[] = {
 	{},
 };
 MODULE_DEVICE_TABLE(of, altera_spi_match);
-#else /* CONFIG_OF */
-#define altera_spi_match NULL
 #endif /* CONFIG_OF */
 
 static struct platform_driver altera_spi_driver = {
@@ -318,7 +316,7 @@  static struct platform_driver altera_spi_driver = {
 		.name = DRV_NAME,
 		.owner = THIS_MODULE,
 		.pm = NULL,
-		.of_match_table = altera_spi_match,
+		.of_match_table = of_match_ptr(altera_spi_match),
 	},
 };
 module_platform_driver(altera_spi_driver);