aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/mvme16x
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k/mvme16x')
-rw-r--r--arch/m68k/mvme16x/rtc.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c
index 8da9c250d3e1..11ac6f63967a 100644
--- a/arch/m68k/mvme16x/rtc.c
+++ b/arch/m68k/mvme16x/rtc.c
@@ -9,7 +9,6 @@
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/miscdevice.h> 11#include <linux/miscdevice.h>
12#include <linux/smp_lock.h>
13#include <linux/ioport.h> 12#include <linux/ioport.h>
14#include <linux/capability.h> 13#include <linux/capability.h>
15#include <linux/fcntl.h> 14#include <linux/fcntl.h>
@@ -36,8 +35,7 @@ static const unsigned char days_in_mo[] =
36 35
37static atomic_t rtc_ready = ATOMIC_INIT(1); 36static atomic_t rtc_ready = ATOMIC_INIT(1);
38 37
39static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 38static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
40 unsigned long arg)
41{ 39{
42 volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE; 40 volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE;
43 unsigned long flags; 41 unsigned long flags;
@@ -120,22 +118,15 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
120} 118}
121 119
122/* 120/*
123 * We enforce only one user at a time here with the open/close. 121 * We enforce only one user at a time here with the open/close.
124 * Also clear the previous interrupt data on an open, and clean
125 * up things on a close.
126 */ 122 */
127
128static int rtc_open(struct inode *inode, struct file *file) 123static int rtc_open(struct inode *inode, struct file *file)
129{ 124{
130 lock_kernel();
131 if( !atomic_dec_and_test(&rtc_ready) ) 125 if( !atomic_dec_and_test(&rtc_ready) )
132 { 126 {
133 atomic_inc( &rtc_ready ); 127 atomic_inc( &rtc_ready );
134 unlock_kernel();
135 return -EBUSY; 128 return -EBUSY;
136 } 129 }
137 unlock_kernel();
138
139 return 0; 130 return 0;
140} 131}
141 132
@@ -150,9 +141,9 @@ static int rtc_release(struct inode *inode, struct file *file)
150 */ 141 */
151 142
152static const struct file_operations rtc_fops = { 143static const struct file_operations rtc_fops = {
153 .ioctl = rtc_ioctl, 144 .unlocked_ioctl = rtc_ioctl,
154 .open = rtc_open, 145 .open = rtc_open,
155 .release = rtc_release, 146 .release = rtc_release,
156}; 147};
157 148
158static struct miscdevice rtc_dev= 149static struct miscdevice rtc_dev=