]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/char/fs3270.c
Pull bugzilla-5653 into release branch
[linux-2.6-omap-h63xx.git] / drivers / s390 / char / fs3270.c
index 735a7fcdeff51dd1616a0481a0ebaa68b57217bc..a6415377bc736b62dfa37277e205334c9381194f 100644 (file)
@@ -319,9 +319,8 @@ fs3270_write(struct file *filp, const char *data, size_t count, loff_t *off)
 /*
  * process ioctl commands for the tube driver
  */
-static int
-fs3270_ioctl(struct inode *inode, struct file *filp,
-            unsigned int cmd, unsigned long arg)
+static long
+fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
        struct fs3270 *fp;
        struct raw3270_iocb iocb;
@@ -331,6 +330,7 @@ fs3270_ioctl(struct inode *inode, struct file *filp,
        if (!fp)
                return -ENODEV;
        rc = 0;
+       lock_kernel();
        switch (cmd) {
        case TUBICMD:
                fp->read_command = arg;
@@ -356,6 +356,7 @@ fs3270_ioctl(struct inode *inode, struct file *filp,
                        rc = -EFAULT;
                break;
        }
+       unlock_kernel();
        return rc;
 }
 
@@ -367,10 +368,9 @@ fs3270_alloc_view(void)
 {
        struct fs3270 *fp;
 
-       fp = (struct fs3270 *) kmalloc(sizeof(struct fs3270),GFP_KERNEL);
+       fp = kzalloc(sizeof(struct fs3270),GFP_KERNEL);
        if (!fp)
                return ERR_PTR(-ENOMEM);
-       memset(fp, 0, sizeof(struct fs3270));
        fp->init = raw3270_request_alloc(0);
        if (IS_ERR(fp->init)) {
                kfree(fp);
@@ -491,12 +491,13 @@ fs3270_close(struct inode *inode, struct file *filp)
 }
 
 static struct file_operations fs3270_fops = {
-       .owner   = THIS_MODULE,         /* owner */
-       .read    = fs3270_read,         /* read */
-       .write   = fs3270_write,        /* write */
-       .ioctl   = fs3270_ioctl,        /* ioctl */
-       .open    = fs3270_open,         /* open */
-       .release = fs3270_close,        /* release */
+       .owner           = THIS_MODULE,         /* owner */
+       .read            = fs3270_read,         /* read */
+       .write           = fs3270_write,        /* write */
+       .unlocked_ioctl  = fs3270_ioctl,        /* ioctl */
+       .compat_ioctl    = fs3270_ioctl,        /* ioctl */
+       .open           = fs3270_open,          /* open */
+       .release        = fs3270_close,         /* release */
 };
 
 /*