video: tegra: nvmap: implement fast api functions
[linux-2.6.git] / drivers / pci / syscall.c
index 2ac050d..e1c1ec5 100644 (file)
@@ -9,15 +9,12 @@
 
 #include <linux/errno.h>
 #include <linux/pci.h>
-#include <linux/smp_lock.h>
 #include <linux/syscalls.h>
 #include <asm/uaccess.h>
 #include "pci.h"
 
-asmlinkage long
-sys_pciconfig_read(unsigned long bus, unsigned long dfn,
-                  unsigned long off, unsigned long len,
-                  void __user *buf)
+SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn,
+               unsigned long, off, unsigned long, len, void __user *, buf)
 {
        struct pci_dev *dev;
        u8 byte;
@@ -34,7 +31,6 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
        if (!dev)
                goto error;
 
-       lock_kernel();
        switch (len) {
        case 1:
                cfg_ret = pci_user_read_config_byte(dev, off, &byte);
@@ -47,10 +43,8 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
                break;
        default:
                err = -EINVAL;
-               unlock_kernel();
                goto error;
        };
-       unlock_kernel();
 
        err = -EIO;
        if (cfg_ret != PCIBIOS_SUCCESSFUL)
@@ -89,10 +83,8 @@ error:
        return err;
 }
 
-asmlinkage long
-sys_pciconfig_write(unsigned long bus, unsigned long dfn,
-                   unsigned long off, unsigned long len,
-                   void __user *buf)
+SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn,
+               unsigned long, off, unsigned long, len, void __user *, buf)
 {
        struct pci_dev *dev;
        u8 byte;
@@ -107,7 +99,6 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
        if (!dev)
                return -ENODEV;
 
-       lock_kernel();
        switch(len) {
        case 1:
                err = get_user(byte, (u8 __user *)buf);
@@ -140,7 +131,6 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
                err = -EINVAL;
                break;
        }
-       unlock_kernel();
        pci_dev_put(dev);
        return err;
 }