Skip to contentSkip to conversation

mmc: sdhci-{pxav2,pxav3}: Use of_match_ptr() macro

PATCH Applied Axel Lin 3 participants 3 messages May 5, 2015

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mmc: sdhci-{pxav2,pxav3}: Use of_match_ptr() macro

This eliminates having an #ifdef returning NULL for the case when OF is disabled.

---
 drivers/mmc/host/sdhci-pxav2.c | 4 +---
 drivers/mmc/host/sdhci-pxav3.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/mmc/host/sdhci-pxav2.c +1 -3
index f98008b..beffd86 100644
@@ -252,9 +252,7 @@ static int sdhci_pxav2_remove(struct platform_device *pdev)
 static struct platform_driver sdhci_pxav2_driver = {
 	.driver		= {
 		.name	= "sdhci-pxav2",
-#ifdef CONFIG_OF
-		.of_match_table = sdhci_pxav2_of_match,
-#endif
+		.of_match_table = of_match_ptr(sdhci_pxav2_of_match),
 		.pm	= SDHCI_PLTFM_PMOPS,
 	},
 	.probe		= sdhci_pxav2_probe,
drivers/mmc/host/sdhci-pxav3.c +1 -3
index b5103a2..01cb2d3 100644
@@ -578,9 +578,7 @@ static const struct dev_pm_ops sdhci_pxav3_pmops = {
 static struct platform_driver sdhci_pxav3_driver = {
 	.driver		= {
 		.name	= "sdhci-pxav3",
-#ifdef CONFIG_OF
-		.of_match_table = sdhci_pxav3_of_match,
-#endif
+		.of_match_table = of_match_ptr(sdhci_pxav3_of_match),
 		.pm	= SDHCI_PXAV3_PMOPS,
 	},
 	.probe		= sdhci_pxav3_probe,
Signature · 1 line
2.1.0
#1 lore raw
Quoted 29 lines · On Tue, 5 May 2015 02:11:54 -0700 Axel Lin <[email protected]> wrote:

This eliminates having an #ifdef returning NULL for the case when OF is disabled.

---
 drivers/mmc/host/sdhci-pxav2.c | 4 +---
 drivers/mmc/host/sdhci-pxav3.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/mmc/host/sdhci-pxav2.c +1 -3
index f98008b..beffd86 100644
@@ -252,9 +252,7 @@ static int sdhci_pxav2_remove(struct platform_device *pdev)
 static struct platform_driver sdhci_pxav2_driver = {
 	.driver		= {
 		.name	= "sdhci-pxav2",
-#ifdef CONFIG_OF
-		.of_match_table = sdhci_pxav2_of_match,
-#endif
+		.of_match_table = of_match_ptr(sdhci_pxav2_of_match),
 		.pm	= SDHCI_PLTFM_PMOPS,
 	},
 	.probe		= sdhci_pxav2_probe,
drivers/mmc/host/sdhci-pxav3.c +0 -0
index b5103a2..01cb2d3 100644

drivers/mmc/host/sdhci-pxav3.c static const struct dev_pm_ops sdhci_pxav3_pmops = { · line 584

Quoted 10 lines
drivers/mmc/host/sdhci-pxav3.c +1 -3
@@ -578,9 +578,7 @@ static const struct dev_pm_ops sdhci_pxav3_pmops = {
 static struct platform_driver sdhci_pxav3_driver = {
 	.driver		= {
 		.name	= "sdhci-pxav3",
-#ifdef CONFIG_OF
-		.of_match_table = sdhci_pxav3_of_match,
-#endif
+		.of_match_table = of_match_ptr(sdhci_pxav3_of_match),
 		.pm	= SDHCI_PXAV3_PMOPS,
 	},
 	.probe		= sdhci_pxav3_probe,

Looks good to me.

Thanks

Applied
#2 lore raw
Quoted 45 lines · Jisheng Zhang
Quoted 29 lines · On Tue, 5 May 2015 02:11:54 -0700 Axel Lin <[email protected]> wrote:

This eliminates having an #ifdef returning NULL for the case when OF is disabled.

---
 drivers/mmc/host/sdhci-pxav2.c | 4 +---
 drivers/mmc/host/sdhci-pxav3.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/mmc/host/sdhci-pxav2.c +1 -3
index f98008b..beffd86 100644
@@ -252,9 +252,7 @@ static int sdhci_pxav2_remove(struct platform_device *pdev)
 static struct platform_driver sdhci_pxav2_driver = {
      .driver         = {
              .name   = "sdhci-pxav2",
-#ifdef CONFIG_OF
-             .of_match_table = sdhci_pxav2_of_match,
-#endif
+             .of_match_table = of_match_ptr(sdhci_pxav2_of_match),
              .pm     = SDHCI_PLTFM_PMOPS,
      },
      .probe          = sdhci_pxav2_probe,
drivers/mmc/host/sdhci-pxav3.c +0 -0
index b5103a2..01cb2d3 100644

drivers/mmc/host/sdhci-pxav3.c static const struct dev_pm_ops sdhci_pxav3_pmops = { · line 584

Quoted 10 lines
drivers/mmc/host/sdhci-pxav3.c +1 -3
@@ -578,9 +578,7 @@ static const struct dev_pm_ops sdhci_pxav3_pmops = {
 static struct platform_driver sdhci_pxav3_driver = {
      .driver         = {
              .name   = "sdhci-pxav3",
-#ifdef CONFIG_OF
-             .of_match_table = sdhci_pxav3_of_match,
-#endif
+             .of_match_table = of_match_ptr(sdhci_pxav3_of_match),
              .pm     = SDHCI_PXAV3_PMOPS,
      },
      .probe          = sdhci_pxav3_probe,

Looks good to me.

Quoted 1 line

Thanks

I consider that as an ack.

Thanks, applied.

Kind regards
Uffe