lis3: separate configuration function for 8 bit device
[safe/jmp/linux-2.6] / drivers / char / efirtc.c
index 004141d..53c524e 100644 (file)
@@ -18,7 +18,7 @@
  *
  * NOTES:
  *     - Locking is required for safe execution of EFI calls with regards
- *       to interrrupts and SMP.
+ *       to interrupts and SMP.
  *
  * TODO (December 1999):
  *     - provide the API to set/get the WakeUp Alarm (different from the
@@ -27,7 +27,6 @@
  *     - Add module support
  */
 
-
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
@@ -36,8 +35,8 @@
 #include <linux/rtc.h>
 #include <linux/proc_fs.h>
 #include <linux/efi.h>
+#include <linux/uaccess.h>
 
-#include <asm/uaccess.h>
 #include <asm/system.h>
 
 #define EFI_RTC_VERSION                "0.4"
@@ -50,8 +49,8 @@
 
 static DEFINE_SPINLOCK(efi_rtc_lock);
 
-static int efi_rtc_ioctl(struct inode *inode, struct file *file,
-                    unsigned int cmd, unsigned long arg);
+static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
+                                                       unsigned long arg);
 
 #define is_leap(year) \
           ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
@@ -145,9 +144,8 @@ convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime)
        }
 }
 
-static int
-efi_rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-                    unsigned long arg)
+static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
+                                                       unsigned long arg)
 {
 
        efi_status_t    status;
@@ -174,7 +172,6 @@ efi_rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                        return -EINVAL;
 
                case RTC_RD_TIME:
-
                        spin_lock_irqsave(&efi_rtc_lock, flags);
 
                        status = efi.get_time(&eft, &cap);
@@ -255,7 +252,7 @@ efi_rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                        return copy_to_user(&ewp->time, &wtime,
                                            sizeof(struct rtc_time)) ? -EFAULT : 0;
        }
-       return -EINVAL;
+       return -ENOTTY;
 }
 
 /*
@@ -264,8 +261,7 @@ efi_rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
  *     up things on a close.
  */
 
-static int
-efi_rtc_open(struct inode *inode, struct file *file)
+static int efi_rtc_open(struct inode *inode, struct file *file)
 {
        /*
         * nothing special to do here
@@ -275,8 +271,7 @@ efi_rtc_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int
-efi_rtc_close(struct inode *inode, struct file *file)
+static int efi_rtc_close(struct inode *inode, struct file *file)
 {
        return 0;
 }
@@ -287,13 +282,13 @@ efi_rtc_close(struct inode *inode, struct file *file)
 
 static const struct file_operations efi_rtc_fops = {
        .owner          = THIS_MODULE,
-       .ioctl          = efi_rtc_ioctl,
+       .unlocked_ioctl = efi_rtc_ioctl,
        .open           = efi_rtc_open,
        .release        = efi_rtc_close,
+       .llseek         = no_llseek,
 };
 
-static struct miscdevice efi_rtc_dev=
-{
+static struct miscdevice efi_rtc_dev= {
        EFI_RTC_MINOR,
        "efirtc",
        &efi_rtc_fops