]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/rtc: use of_match_ptr() macro
authorSachin Kamat <sachin.kamat@linaro.org>
Thu, 7 Feb 2013 01:27:44 +0000 (12:27 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:47:15 +0000 (16:47 +1100)
This eliminates having an #ifdef returning NULL for the case when OF is
disabled.  Maintains consistency in cases where OF is always selected.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/rtc-cmos.c
drivers/rtc/rtc-mpc5121.c
drivers/rtc/rtc-sa1100.c
drivers/rtc/rtc-snvs.c
drivers/rtc/rtc-stmp3xxx.c

index 16630aa87f45d181d37576fa2e71576196f1da53..9deb9e47a67c33fb4df30a2c02ecd498d5b3c6b3 100644 (file)
@@ -1098,7 +1098,6 @@ static __init void cmos_of_init(struct platform_device *pdev)
 }
 #else
 static inline void cmos_of_init(struct platform_device *pdev) {}
-#define of_cmos_match NULL
 #endif
 /*----------------------------------------------------------------*/
 
@@ -1140,7 +1139,7 @@ static struct platform_driver cmos_platform_driver = {
 #ifdef CONFIG_PM
                .pm             = &cmos_pm_ops,
 #endif
-               .of_match_table = of_cmos_match,
+               .of_match_table = of_match_ptr(of_cmos_match),
        }
 };
 
index bec10be96f84222a7d50d9742c8d84f920b37170..bdcc60830aece4757cff90a22e14f9c46487c313 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/rtc.h>
+#include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
 #include <linux/io.h>
@@ -403,17 +404,19 @@ static int mpc5121_rtc_remove(struct platform_device *op)
        return 0;
 }
 
+#ifdef CONFIG_OF
 static struct of_device_id mpc5121_rtc_match[] = {
        { .compatible = "fsl,mpc5121-rtc", },
        { .compatible = "fsl,mpc5200-rtc", },
        {},
 };
+#endif
 
 static struct platform_driver mpc5121_rtc_driver = {
        .driver = {
                .name = "mpc5121-rtc",
                .owner = THIS_MODULE,
-               .of_match_table = mpc5121_rtc_match,
+               .of_match_table = of_match_ptr(mpc5121_rtc_match),
        },
        .probe = mpc5121_rtc_probe,
        .remove = mpc5121_rtc_remove,
index 50a5c4adee4807e7027fefb392bd137e63aca0f8..df9180e80e3a5d50e0a2cb20c3eada54153fbbb2 100644 (file)
@@ -349,12 +349,14 @@ static const struct dev_pm_ops sa1100_rtc_pm_ops = {
 };
 #endif
 
+#ifdef CONFIG_OF
 static struct of_device_id sa1100_rtc_dt_ids[] = {
        { .compatible = "mrvl,sa1100-rtc", },
        { .compatible = "mrvl,mmp-rtc", },
        {}
 };
 MODULE_DEVICE_TABLE(of, sa1100_rtc_dt_ids);
+#endif
 
 static struct platform_driver sa1100_rtc_driver = {
        .probe          = sa1100_rtc_probe,
@@ -364,7 +366,7 @@ static struct platform_driver sa1100_rtc_driver = {
 #ifdef CONFIG_PM
                .pm     = &sa1100_rtc_pm_ops,
 #endif
-               .of_match_table = sa1100_rtc_dt_ids,
+               .of_match_table = of_match_ptr(sa1100_rtc_dt_ids),
        },
 };
 
index 40662e9dc0abf042e62bf85d66a13f87c657ee04..f7d90703db5e5dc38f96a234fa78c90b00e7810b 100644 (file)
@@ -338,7 +338,7 @@ static struct platform_driver snvs_rtc_driver = {
                .name   = "snvs_rtc",
                .owner  = THIS_MODULE,
                .pm     = &snvs_rtc_pm_ops,
-               .of_match_table = snvs_dt_ids,
+               .of_match_table = of_match_ptr(snvs_dt_ids),
        },
        .probe          = snvs_rtc_probe,
        .remove         = snvs_rtc_remove,
index cc9a9b652b13e16a2a49967b79dbff04c200c01d..98f0d3c30738bb2cc48238613af255fbdf6789a2 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/rtc.h>
 #include <linux/slab.h>
 #include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/stmp_device.h>
 #include <linux/stmp3xxx_rtc_wdt.h>
 
@@ -344,7 +345,7 @@ static struct platform_driver stmp3xxx_rtcdrv = {
        .driver         = {
                .name   = "stmp3xxx-rtc",
                .owner  = THIS_MODULE,
-               .of_match_table = rtc_dt_ids,
+               .of_match_table = of_match_ptr(rtc_dt_ids),
        },
 };