static unsigned short enable_dyn_sleep = 0; /* disabled till drivers are fixed */
 
-static ssize_t omap_pm_sleep_while_idle_show(struct kset * subsys, char *buf)
+static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr,
+                        char *buf)
 {
        return sprintf(buf, "%hu\n", enable_dyn_sleep);
 }
 
-static ssize_t omap_pm_sleep_while_idle_store(struct kset * subsys,
-                                             const char * buf,
-                                             size_t n)
+static ssize_t idle_store(struct kobject *kobj, struct kobj_attribute *attr,
+                         const char * buf, size_t n)
 {
        unsigned short value;
        if (sscanf(buf, "%hu", &value) != 1 ||
        return n;
 }
 
-static struct subsys_attribute sleep_while_idle_attr = {
-       .attr   = {
-               .name = __stringify(sleep_while_idle),
-               .mode = 0644,
-       },
-       .show   = omap_pm_sleep_while_idle_show,
-       .store  = omap_pm_sleep_while_idle_store,
-};
+static struct kobj_attribute sleep_while_idle_attr =
+       __ATTR(sleep_while_idle, 0644, idle_show, idle_store);
 
 static struct clk *osc_ck, *emul_ck;
 
 int __init omap2_pm_init(void)
 {
        u32 l;
+       int error;
 
        printk(KERN_INFO "Power Management for OMAP2 initializing\n");
        l = prm_read_reg(OMAP24XX_PRCM_REVISION);
        suspend_set_ops(&omap_pm_ops);
        pm_idle = omap2_pm_idle;
 
-       l = subsys_create_file(&power_subsys, &sleep_while_idle_attr);
-       if (l)
-               printk(KERN_ERR "subsys_create_file failed: %d\n", l);
+       error = sysfs_create_file(power_kobj, &sleep_while_idle_attr);
+       if (error)
+               printk(KERN_ERR "sysfs_create_file failed: %d\n", error);
 
        return 0;
 }
 
 static DEVICE_ATTR(cal, S_IRUGO | S_IWUSR, retu_rtc_cal_show,
                   retu_rtc_cal_store);
 
-static struct device_driver retu_rtc_driver;
+static struct platform_device retu_rtc_device;
 
 static void retu_rtca_disable(void)
 {
 static void retu_rtca_expired(struct work_struct *unused)
 {
        retu_rtca_disable();
-       sysfs_notify(&retu_rtc_driver.kobj, NULL, "alarm_expired");
+       sysfs_notify(&retu_rtc_device.dev.kobj, NULL, "alarm_expired");
 }
 
 DECLARE_WORK(retu_rtca_work, retu_rtca_expired);