int rtc_hctosys_ret = -ENODEV;
 #endif
 
-#if defined(CONFIG_PM) && defined(CONFIG_RTC_HCTOSYS_DEVICE)
+#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_RTC_HCTOSYS_DEVICE)
 /*
  * On suspend(), measure the delta between one RTC and the
  * system's wall clock; restore it on resume().
 static struct timespec old_rtc, old_system, old_delta;
 
 
-static int rtc_suspend(struct device *dev, pm_message_t mesg)
+static int rtc_suspend(struct device *dev)
 {
        struct rtc_device       *rtc = to_rtc_device(dev);
        struct rtc_time         tm;
        return 0;
 }
 
+static SIMPLE_DEV_PM_OPS(rtc_class_dev_pm_ops, rtc_suspend, rtc_resume);
+#define RTC_CLASS_DEV_PM_OPS   (&rtc_class_dev_pm_ops)
 #else
-#define rtc_suspend    NULL
-#define rtc_resume     NULL
+#define RTC_CLASS_DEV_PM_OPS   NULL
 #endif
 
 
                pr_err("couldn't create class\n");
                return PTR_ERR(rtc_class);
        }
-       rtc_class->suspend = rtc_suspend;
-       rtc_class->resume = rtc_resume;
+       rtc_class->pm = RTC_CLASS_DEV_PM_OPS;
        rtc_dev_init();
        rtc_sysfs_init(rtc_class);
        return 0;