diff options
author | Christoph Hellwig <hch@lst.de> | 2005-11-09 15:07:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-11-09 15:07:18 -0500 |
commit | 8ca2bdc7a98b9584ac5f640761501405154171c7 (patch) | |
tree | 9d9a601fa9c189e5726d09a778e0ac29330a36dd | |
parent | feee207e44d3643d19e648af3c88946bd1c5106b (diff) |
[SPARC] sbus rtc: implement ->compat_ioctl
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | arch/sparc64/kernel/ioctl32.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/rtc.c | 22 |
2 files changed, 22 insertions, 2 deletions
diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c index c2e96daa5ab3..e62214354bb5 100644 --- a/arch/sparc64/kernel/ioctl32.c +++ b/arch/sparc64/kernel/ioctl32.c | |||
@@ -114,8 +114,6 @@ COMPATIBLE_IOCTL(FBIOGCURPOS) | |||
114 | COMPATIBLE_IOCTL(FBIOGCURMAX) | 114 | COMPATIBLE_IOCTL(FBIOGCURMAX) |
115 | /* Little k */ | 115 | /* Little k */ |
116 | /* Little v, the video4linux ioctls */ | 116 | /* Little v, the video4linux ioctls */ |
117 | COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */ | ||
118 | COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */ | ||
119 | /* And these ioctls need translation */ | 117 | /* And these ioctls need translation */ |
120 | /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */ | 118 | /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */ |
121 | HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap) | 119 | HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap) |
diff --git a/drivers/sbus/char/rtc.c b/drivers/sbus/char/rtc.c index 9b988baf0b51..5774bdd0e26f 100644 --- a/drivers/sbus/char/rtc.c +++ b/drivers/sbus/char/rtc.c | |||
@@ -210,6 +210,27 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
213 | static long rtc_compat_ioctl(struct file *file, unsigned int cmd, | ||
214 | unsigned long arg) | ||
215 | { | ||
216 | int rval = -ENOIOCTLCMD; | ||
217 | |||
218 | switch (cmd) { | ||
219 | /* | ||
220 | * These two are specific to this driver, the generic rtc ioctls | ||
221 | * are hanlded elsewhere. | ||
222 | */ | ||
223 | case RTCGET: | ||
224 | case RTCSET: | ||
225 | lock_kernel(); | ||
226 | rval = rtc_ioctl(file->f_dentry->d_inode, file, cmd, arg); | ||
227 | unlock_kernel(); | ||
228 | break; | ||
229 | } | ||
230 | |||
231 | return rval; | ||
232 | } | ||
233 | |||
213 | static int rtc_open(struct inode *inode, struct file *file) | 234 | static int rtc_open(struct inode *inode, struct file *file) |
214 | { | 235 | { |
215 | int ret; | 236 | int ret; |
@@ -237,6 +258,7 @@ static struct file_operations rtc_fops = { | |||
237 | .owner = THIS_MODULE, | 258 | .owner = THIS_MODULE, |
238 | .llseek = no_llseek, | 259 | .llseek = no_llseek, |
239 | .ioctl = rtc_ioctl, | 260 | .ioctl = rtc_ioctl, |
261 | .compat_ioctl = rtc_compat_ioctl, | ||
240 | .open = rtc_open, | 262 | .open = rtc_open, |
241 | .release = rtc_release, | 263 | .release = rtc_release, |
242 | }; | 264 | }; |