diff options
Diffstat (limited to 'drivers/rtc/rtc-dev.c')
-rw-r--r-- | drivers/rtc/rtc-dev.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index cace6d3aed9a..d04939369251 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
@@ -11,6 +11,8 @@ | |||
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
15 | |||
14 | #include <linux/module.h> | 16 | #include <linux/module.h> |
15 | #include <linux/rtc.h> | 17 | #include <linux/rtc.h> |
16 | #include <linux/sched.h> | 18 | #include <linux/sched.h> |
@@ -379,25 +381,6 @@ static long rtc_dev_ioctl(struct file *file, | |||
379 | err = put_user(rtc->irq_freq, (unsigned long __user *)uarg); | 381 | err = put_user(rtc->irq_freq, (unsigned long __user *)uarg); |
380 | break; | 382 | break; |
381 | 383 | ||
382 | #if 0 | ||
383 | case RTC_EPOCH_SET: | ||
384 | #ifndef rtc_epoch | ||
385 | /* | ||
386 | * There were no RTC clocks before 1900. | ||
387 | */ | ||
388 | if (arg < 1900) { | ||
389 | err = -EINVAL; | ||
390 | break; | ||
391 | } | ||
392 | rtc_epoch = arg; | ||
393 | err = 0; | ||
394 | #endif | ||
395 | break; | ||
396 | |||
397 | case RTC_EPOCH_READ: | ||
398 | err = put_user(rtc_epoch, (unsigned long __user *)uarg); | ||
399 | break; | ||
400 | #endif | ||
401 | case RTC_WKALM_SET: | 384 | case RTC_WKALM_SET: |
402 | mutex_unlock(&rtc->ops_lock); | 385 | mutex_unlock(&rtc->ops_lock); |
403 | if (copy_from_user(&alarm, uarg, sizeof(alarm))) | 386 | if (copy_from_user(&alarm, uarg, sizeof(alarm))) |
@@ -481,7 +464,7 @@ void rtc_dev_prepare(struct rtc_device *rtc) | |||
481 | return; | 464 | return; |
482 | 465 | ||
483 | if (rtc->id >= RTC_DEV_MAX) { | 466 | if (rtc->id >= RTC_DEV_MAX) { |
484 | pr_debug("%s: too many RTC devices\n", rtc->name); | 467 | dev_dbg(&rtc->dev, "%s: too many RTC devices\n", rtc->name); |
485 | return; | 468 | return; |
486 | } | 469 | } |
487 | 470 | ||
@@ -499,10 +482,10 @@ void rtc_dev_prepare(struct rtc_device *rtc) | |||
499 | void rtc_dev_add_device(struct rtc_device *rtc) | 482 | void rtc_dev_add_device(struct rtc_device *rtc) |
500 | { | 483 | { |
501 | if (cdev_add(&rtc->char_dev, rtc->dev.devt, 1)) | 484 | if (cdev_add(&rtc->char_dev, rtc->dev.devt, 1)) |
502 | printk(KERN_WARNING "%s: failed to add char device %d:%d\n", | 485 | dev_warn(&rtc->dev, "%s: failed to add char device %d:%d\n", |
503 | rtc->name, MAJOR(rtc_devt), rtc->id); | 486 | rtc->name, MAJOR(rtc_devt), rtc->id); |
504 | else | 487 | else |
505 | pr_debug("%s: dev (%d:%d)\n", rtc->name, | 488 | dev_dbg(&rtc->dev, "%s: dev (%d:%d)\n", rtc->name, |
506 | MAJOR(rtc_devt), rtc->id); | 489 | MAJOR(rtc_devt), rtc->id); |
507 | } | 490 | } |
508 | 491 | ||
@@ -518,8 +501,7 @@ void __init rtc_dev_init(void) | |||
518 | 501 | ||
519 | err = alloc_chrdev_region(&rtc_devt, 0, RTC_DEV_MAX, "rtc"); | 502 | err = alloc_chrdev_region(&rtc_devt, 0, RTC_DEV_MAX, "rtc"); |
520 | if (err < 0) | 503 | if (err < 0) |
521 | printk(KERN_ERR "%s: failed to allocate char dev region\n", | 504 | pr_err("failed to allocate char dev region\n"); |
522 | __FILE__); | ||
523 | } | 505 | } |
524 | 506 | ||
525 | void __exit rtc_dev_exit(void) | 507 | void __exit rtc_dev_exit(void) |