aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/efirtc.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/char/efirtc.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/char/efirtc.c')
-rw-r--r--drivers/char/efirtc.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c
index 34d15d548236..53c524e7b829 100644
--- a/drivers/char/efirtc.c
+++ b/drivers/char/efirtc.c
@@ -27,8 +27,6 @@
27 * - Add module support 27 * - Add module support
28 */ 28 */
29 29
30
31#include <linux/smp_lock.h>
32#include <linux/types.h> 30#include <linux/types.h>
33#include <linux/errno.h> 31#include <linux/errno.h>
34#include <linux/miscdevice.h> 32#include <linux/miscdevice.h>
@@ -174,13 +172,12 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
174 return -EINVAL; 172 return -EINVAL;
175 173
176 case RTC_RD_TIME: 174 case RTC_RD_TIME:
177 lock_kernel();
178 spin_lock_irqsave(&efi_rtc_lock, flags); 175 spin_lock_irqsave(&efi_rtc_lock, flags);
179 176
180 status = efi.get_time(&eft, &cap); 177 status = efi.get_time(&eft, &cap);
181 178
182 spin_unlock_irqrestore(&efi_rtc_lock,flags); 179 spin_unlock_irqrestore(&efi_rtc_lock,flags);
183 unlock_kernel(); 180
184 if (status != EFI_SUCCESS) { 181 if (status != EFI_SUCCESS) {
185 /* should never happen */ 182 /* should never happen */
186 printk(KERN_ERR "efitime: can't read time\n"); 183 printk(KERN_ERR "efitime: can't read time\n");
@@ -202,13 +199,11 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
202 199
203 convert_to_efi_time(&wtime, &eft); 200 convert_to_efi_time(&wtime, &eft);
204 201
205 lock_kernel();
206 spin_lock_irqsave(&efi_rtc_lock, flags); 202 spin_lock_irqsave(&efi_rtc_lock, flags);
207 203
208 status = efi.set_time(&eft); 204 status = efi.set_time(&eft);
209 205
210 spin_unlock_irqrestore(&efi_rtc_lock,flags); 206 spin_unlock_irqrestore(&efi_rtc_lock,flags);
211 unlock_kernel();
212 207
213 return status == EFI_SUCCESS ? 0 : -EINVAL; 208 return status == EFI_SUCCESS ? 0 : -EINVAL;
214 209
@@ -224,7 +219,6 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
224 219
225 convert_to_efi_time(&wtime, &eft); 220 convert_to_efi_time(&wtime, &eft);
226 221
227 lock_kernel();
228 spin_lock_irqsave(&efi_rtc_lock, flags); 222 spin_lock_irqsave(&efi_rtc_lock, flags);
229 /* 223 /*
230 * XXX Fixme: 224 * XXX Fixme:
@@ -235,19 +229,16 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
235 status = efi.set_wakeup_time((efi_bool_t)enabled, &eft); 229 status = efi.set_wakeup_time((efi_bool_t)enabled, &eft);
236 230
237 spin_unlock_irqrestore(&efi_rtc_lock,flags); 231 spin_unlock_irqrestore(&efi_rtc_lock,flags);
238 unlock_kernel();
239 232
240 return status == EFI_SUCCESS ? 0 : -EINVAL; 233 return status == EFI_SUCCESS ? 0 : -EINVAL;
241 234
242 case RTC_WKALM_RD: 235 case RTC_WKALM_RD:
243 236
244 lock_kernel();
245 spin_lock_irqsave(&efi_rtc_lock, flags); 237 spin_lock_irqsave(&efi_rtc_lock, flags);
246 238
247 status = efi.get_wakeup_time((efi_bool_t *)&enabled, (efi_bool_t *)&pending, &eft); 239 status = efi.get_wakeup_time((efi_bool_t *)&enabled, (efi_bool_t *)&pending, &eft);
248 240
249 spin_unlock_irqrestore(&efi_rtc_lock,flags); 241 spin_unlock_irqrestore(&efi_rtc_lock,flags);
250 unlock_kernel();
251 242
252 if (status != EFI_SUCCESS) return -EINVAL; 243 if (status != EFI_SUCCESS) return -EINVAL;
253 244
@@ -277,7 +268,6 @@ static int efi_rtc_open(struct inode *inode, struct file *file)
277 * We do accept multiple open files at the same time as we 268 * We do accept multiple open files at the same time as we
278 * synchronize on the per call operation. 269 * synchronize on the per call operation.
279 */ 270 */
280 cycle_kernel_lock();
281 return 0; 271 return 0;
282} 272}
283 273
@@ -295,6 +285,7 @@ static const struct file_operations efi_rtc_fops = {
295 .unlocked_ioctl = efi_rtc_ioctl, 285 .unlocked_ioctl = efi_rtc_ioctl,
296 .open = efi_rtc_open, 286 .open = efi_rtc_open,
297 .release = efi_rtc_close, 287 .release = efi_rtc_close,
288 .llseek = no_llseek,
298}; 289};
299 290
300static struct miscdevice efi_rtc_dev= { 291static struct miscdevice efi_rtc_dev= {