aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-dev.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-08-22 20:33:04 -0400
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-08-24 10:34:51 -0400
commitea369ea6d828930c0cf0cacf81f6fd9dff61992d (patch)
tree5c0ca38a3319f5e9949899824bf5bc9911d873e4 /drivers/rtc/rtc-dev.c
parent604c78235a35202e2150866dcf12f27eed5c6a04 (diff)
rtc: remove .open() and .release()
There are no driver left using .open and .release. There is no good use case for them as there is nothing the character device interface does that should not be done in the sysfs interface or in-kernel interface. Remove those callbacks now to avoid future confusion. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc/rtc-dev.c')
-rw-r--r--drivers/rtc/rtc-dev.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 794bc4fa4937..00efe24a6063 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -24,28 +24,19 @@ static dev_t rtc_devt;
24 24
25static int rtc_dev_open(struct inode *inode, struct file *file) 25static int rtc_dev_open(struct inode *inode, struct file *file)
26{ 26{
27 int err;
28 struct rtc_device *rtc = container_of(inode->i_cdev, 27 struct rtc_device *rtc = container_of(inode->i_cdev,
29 struct rtc_device, char_dev); 28 struct rtc_device, char_dev);
30 const struct rtc_class_ops *ops = rtc->ops;
31 29
32 if (test_and_set_bit_lock(RTC_DEV_BUSY, &rtc->flags)) 30 if (test_and_set_bit_lock(RTC_DEV_BUSY, &rtc->flags))
33 return -EBUSY; 31 return -EBUSY;
34 32
35 file->private_data = rtc; 33 file->private_data = rtc;
36 34
37 err = ops->open ? ops->open(rtc->dev.parent) : 0; 35 spin_lock_irq(&rtc->irq_lock);
38 if (err == 0) { 36 rtc->irq_data = 0;
39 spin_lock_irq(&rtc->irq_lock); 37 spin_unlock_irq(&rtc->irq_lock);
40 rtc->irq_data = 0;
41 spin_unlock_irq(&rtc->irq_lock);
42
43 return 0;
44 }
45 38
46 /* something has gone wrong */ 39 return 0;
47 clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags);
48 return err;
49} 40}
50 41
51#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL 42#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
@@ -438,9 +429,6 @@ static int rtc_dev_release(struct inode *inode, struct file *file)
438 rtc_update_irq_enable(rtc, 0); 429 rtc_update_irq_enable(rtc, 0);
439 rtc_irq_set_state(rtc, NULL, 0); 430 rtc_irq_set_state(rtc, NULL, 0);
440 431
441 if (rtc->ops->release)
442 rtc->ops->release(rtc->dev.parent);
443
444 clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags); 432 clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags);
445 return 0; 433 return 0;
446} 434}