Add pm_ops_ptr() macro that allows the .pm entry in driver structures
to be assigned without having an #define xxx NULL for the case that
CONFIG_PM is not set.
[rjw: Changelog]
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
}
#endif
-#ifdef CONFIG_PM
static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
#ifdef CONFIG_PM_SLEEP
.suspend_noirq = s3c24xx_i2c_suspend_noirq,
#endif
};
-#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
-#else
-#define S3C24XX_DEV_PM_OPS NULL
-#endif
-
/* device driver for platform bus bits */
static struct platform_driver s3c24xx_i2c_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "s3c-i2c",
- .pm = S3C24XX_DEV_PM_OPS,
+ .pm = pm_ops_ptr(&s3c24xx_i2c_dev_pm_ops),
.of_match_table = of_match_ptr(s3c24xx_i2c_match),
},
};
#ifdef CONFIG_PM
extern const char power_group_name[]; /* = "power" */
+#define pm_ops_ptr(_ptr) (_ptr)
#else
#define power_group_name NULL
+#define pm_ops_ptr(_ptr) NULL
#endif
typedef struct pm_message {