diff mbox

[1/4] spi: altera: remove unnecessary #ifdef CONFIG_OF

Message ID 002a01cfc65d$2dc86640$895932c0$%han@samsung.com (mailing list archive)
State Rejected
Headers show

Commit Message

Jingoo Han Sept. 2, 2014, 3:22 a.m. UTC
Remove unnecessary #ifdef CONFIG_OF, because this is already
handled by the of_match_ptr macro.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/spi/spi-altera.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Axel Lin Sept. 2, 2014, 5:34 a.m. UTC | #1
2014-09-02 11:22 GMT+08:00 Jingoo Han <jg1.han@samsung.com>:
> Remove unnecessary #ifdef CONFIG_OF, because this is already
> handled by the of_match_ptr macro.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
>  drivers/spi/spi-altera.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c
> index 5b5709a5c957..588d428f47c8 100644
> --- a/drivers/spi/spi-altera.c
> +++ b/drivers/spi/spi-altera.c
> @@ -268,14 +268,12 @@ static int altera_spi_remove(struct platform_device *dev)
>         return 0;
>  }
>
> -#ifdef CONFIG_OF
>  static const struct of_device_id altera_spi_match[] = {
>         { .compatible = "ALTR,spi-1.0", },
>         { .compatible = "altr,spi-1.0", },
>         {},
>  };
>  MODULE_DEVICE_TABLE(of, altera_spi_match);
> -#endif /* CONFIG_OF */

For !CONFIG_OF case:
        #define of_match_ptr(_ptr)      NULL
Can you explain how of_match_ptr() handle this?

Thanks,
Axel
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown Sept. 2, 2014, 11:16 a.m. UTC | #2
On Tue, Sep 02, 2014 at 01:34:39PM +0800, Axel Lin wrote:

> > -#ifdef CONFIG_OF
> >  static const struct of_device_id altera_spi_match[] = {
> >         { .compatible = "ALTR,spi-1.0", },
> >         { .compatible = "altr,spi-1.0", },
> >         {},
> >  };
> >  MODULE_DEVICE_TABLE(of, altera_spi_match);
> > -#endif /* CONFIG_OF */

> For !CONFIG_OF case:
>         #define of_match_ptr(_ptr)      NULL
> Can you explain how of_match_ptr() handle this?

Unless MODULE_DEVICE_TABLE knows about OF that's not going to trigger
the dead code elimination.
diff mbox

Patch

diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c
index 5b5709a5c957..588d428f47c8 100644
--- a/drivers/spi/spi-altera.c
+++ b/drivers/spi/spi-altera.c
@@ -268,14 +268,12 @@  static int altera_spi_remove(struct platform_device *dev)
 	return 0;
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id altera_spi_match[] = {
 	{ .compatible = "ALTR,spi-1.0", },
 	{ .compatible = "altr,spi-1.0", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, altera_spi_match);
-#endif /* CONFIG_OF */
 
 static struct platform_driver altera_spi_driver = {
 	.probe = altera_spi_probe,