aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-dev.c')
-rw-r--r--drivers/rtc/rtc-dev.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 623cb8d06b02..2c13433089a0 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -34,7 +34,7 @@ static int rtc_dev_open(struct inode *inode, struct file *file)
34 34
35 file->private_data = rtc; 35 file->private_data = rtc;
36 36
37 err = ops->open ? ops->open(rtc->class_dev.dev) : 0; 37 err = ops->open ? ops->open(rtc->dev.parent) : 0;
38 if (err == 0) { 38 if (err == 0) {
39 spin_lock_irq(&rtc->irq_lock); 39 spin_lock_irq(&rtc->irq_lock);
40 rtc->irq_data = 0; 40 rtc->irq_data = 0;
@@ -180,7 +180,7 @@ rtc_dev_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
180 if (ret == 0) { 180 if (ret == 0) {
181 /* Check for any data updates */ 181 /* Check for any data updates */
182 if (rtc->ops->read_callback) 182 if (rtc->ops->read_callback)
183 data = rtc->ops->read_callback(rtc->class_dev.dev, 183 data = rtc->ops->read_callback(rtc->dev.parent,
184 data); 184 data);
185 185
186 if (sizeof(int) != sizeof(long) && 186 if (sizeof(int) != sizeof(long) &&
@@ -251,7 +251,7 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
251 251
252 /* try the driver's ioctl interface */ 252 /* try the driver's ioctl interface */
253 if (ops->ioctl) { 253 if (ops->ioctl) {
254 err = ops->ioctl(rtc->class_dev.dev, cmd, arg); 254 err = ops->ioctl(rtc->dev.parent, cmd, arg);
255 if (err != -ENOIOCTLCMD) 255 if (err != -ENOIOCTLCMD)
256 return err; 256 return err;
257 } 257 }
@@ -371,7 +371,7 @@ static int rtc_dev_release(struct inode *inode, struct file *file)
371 clear_uie(rtc); 371 clear_uie(rtc);
372#endif 372#endif
373 if (rtc->ops->release) 373 if (rtc->ops->release)
374 rtc->ops->release(rtc->class_dev.dev); 374 rtc->ops->release(rtc->dev.parent);
375 375
376 mutex_unlock(&rtc->char_lock); 376 mutex_unlock(&rtc->char_lock);
377 return 0; 377 return 0;
@@ -406,7 +406,7 @@ void rtc_dev_add_device(struct rtc_device *rtc)
406 return; 406 return;
407 } 407 }
408 408
409 rtc->class_dev.devt = MKDEV(MAJOR(rtc_devt), rtc->id); 409 rtc->dev.devt = MKDEV(MAJOR(rtc_devt), rtc->id);
410 410
411 mutex_init(&rtc->char_lock); 411 mutex_init(&rtc->char_lock);
412 spin_lock_init(&rtc->irq_lock); 412 spin_lock_init(&rtc->irq_lock);
@@ -419,7 +419,7 @@ void rtc_dev_add_device(struct rtc_device *rtc)
419 cdev_init(&rtc->char_dev, &rtc_dev_fops); 419 cdev_init(&rtc->char_dev, &rtc_dev_fops);
420 rtc->char_dev.owner = rtc->owner; 420 rtc->char_dev.owner = rtc->owner;
421 421
422 if (cdev_add(&rtc->char_dev, rtc->class_dev.devt, 1)) 422 if (cdev_add(&rtc->char_dev, rtc->dev.devt, 1))
423 printk(KERN_WARNING "%s: failed to add char device %d:%d\n", 423 printk(KERN_WARNING "%s: failed to add char device %d:%d\n",
424 rtc->name, MAJOR(rtc_devt), rtc->id); 424 rtc->name, MAJOR(rtc_devt), rtc->id);
425 else 425 else
@@ -429,7 +429,7 @@ void rtc_dev_add_device(struct rtc_device *rtc)
429 429
430void rtc_dev_del_device(struct rtc_device *rtc) 430void rtc_dev_del_device(struct rtc_device *rtc)
431{ 431{
432 if (rtc->class_dev.devt) 432 if (rtc->dev.devt)
433 cdev_del(&rtc->char_dev); 433 cdev_del(&rtc->char_dev);
434} 434}
435 435