nfsd: allow exports of symlinks
[safe/jmp/linux-2.6] / drivers / char / sx.c
index a71bc58..a81ec4f 100644 (file)
 #include <linux/eisa.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/smp_lock.h>
 #include <linux/init.h>
 #include <linux/miscdevice.h>
 #include <linux/bitops.h>
@@ -1713,8 +1714,8 @@ static long sx_fw_ioctl(struct file *filp, unsigned int cmd,
                for (i = 0; i < SX_NBOARDS; i++)
                        sx_dprintk(SX_DEBUG_FIRMWARE, "<%x> ", boards[i].flags);
                sx_dprintk(SX_DEBUG_FIRMWARE, "\n");
-               unlock_kernel();
-               return -EIO;
+               rc = -EIO;
+               goto out;
        }
 
        switch (cmd) {
@@ -1746,8 +1747,10 @@ static long sx_fw_ioctl(struct file *filp, unsigned int cmd,
                sx_dprintk(SX_DEBUG_FIRMWARE, "returning type= %ld\n", rc);
                break;
        case SXIO_DO_RAMTEST:
-               if (sx_initialized)     /* Already initialized: better not ramtest the board.  */
-                       return -EPERM;
+               if (sx_initialized) {   /* Already initialized: better not ramtest the board.  */
+                       rc = -EPERM;
+                       break;
+               }
                if (IS_SX_BOARD(board)) {
                        rc = do_memtest(board, 0, 0x7000);
                        if (!rc)
@@ -1787,7 +1790,7 @@ static long sx_fw_ioctl(struct file *filp, unsigned int cmd,
                                                nbytes - i : SX_CHUNK_SIZE)) {
                                        kfree(tmp);
                                        rc = -EFAULT;
-                                       break;
+                                       goto out;
                                }
                                memcpy_toio(board->base2 + offset + i, tmp,
                                                (i + SX_CHUNK_SIZE > nbytes) ?
@@ -1844,6 +1847,7 @@ static long sx_fw_ioctl(struct file *filp, unsigned int cmd,
                rc = -ENOTTY;
                break;
        }
+out:
        unlock_kernel();
        func_exit();
        return rc;
@@ -1941,7 +1945,7 @@ static int sx_ioctl(struct tty_struct *tty, struct file *filp,
 
 static void sx_throttle(struct tty_struct *tty)
 {
-       struct sx_port *port = (struct sx_port *)tty->driver_data;
+       struct sx_port *port = tty->driver_data;
 
        func_enter2();
        /* If the port is using any type of input flow
@@ -1955,7 +1959,7 @@ static void sx_throttle(struct tty_struct *tty)
 
 static void sx_unthrottle(struct tty_struct *tty)
 {
-       struct sx_port *port = (struct sx_port *)tty->driver_data;
+       struct sx_port *port = tty->driver_data;
 
        func_enter2();
        /* Always unthrottle even if flow control is not enabled on