]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge commit 'linus/master' into bkl/core
authorFrederic Weisbecker <fweisbec@gmail.com>
Sun, 8 Aug 2010 23:49:58 +0000 (01:49 +0200)
committerFrederic Weisbecker <fweisbec@gmail.com>
Mon, 9 Aug 2010 00:14:15 +0000 (02:14 +0200)
Merge reason: The staging tree has introduced the easycap
driver lately. We need the latest updates to pushdown the
bkl in its ioctl helper.

1  2 
drivers/media/video/v4l2-dev.c
fs/compat_ioctl.c

index a869418bb8d26dbcbb126c0c62ee208d72ce7fb3,9e89bf617790b46b67ce7cc9155d28df9d8bf9ed..249af6a1d56defcfdbccbee4591479d44b03cea9
@@@ -25,7 -25,6 +25,7 @@@
  #include <linux/init.h>
  #include <linux/kmod.h>
  #include <linux/slab.h>
 +#include <linux/smp_lock.h>
  #include <asm/uaccess.h>
  #include <asm/system.h>
  
@@@ -216,24 -215,28 +216,24 @@@ static unsigned int v4l2_poll(struct fi
        return vdev->fops->poll(filp, poll);
  }
  
 -static int v4l2_ioctl(struct inode *inode, struct file *filp,
 -              unsigned int cmd, unsigned long arg)
 +static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
  {
        struct video_device *vdev = video_devdata(filp);
 +      int ret;
  
 -      if (!vdev->fops->ioctl)
 -              return -ENOTTY;
        /* Allow ioctl to continue even if the device was unregistered.
           Things like dequeueing buffers might still be useful. */
 -      return vdev->fops->ioctl(filp, cmd, arg);
 -}
 -
 -static long v4l2_unlocked_ioctl(struct file *filp,
 -              unsigned int cmd, unsigned long arg)
 -{
 -      struct video_device *vdev = video_devdata(filp);
 +      if (vdev->fops->unlocked_ioctl) {
 +              ret = vdev->fops->unlocked_ioctl(filp, cmd, arg);
 +      } else if (vdev->fops->ioctl) {
 +              /* TODO: convert all drivers to unlocked_ioctl */
 +              lock_kernel();
 +              ret = vdev->fops->ioctl(filp, cmd, arg);
 +              unlock_kernel();
 +      } else
 +              ret = -ENOTTY;
  
 -      if (!vdev->fops->unlocked_ioctl)
 -              return -ENOTTY;
 -      /* Allow ioctl to continue even if the device was unregistered.
 -         Things like dequeueing buffers might still be useful. */
 -      return vdev->fops->unlocked_ioctl(filp, cmd, arg);
 +      return ret;
  }
  
  #ifdef CONFIG_MMU
@@@ -304,6 -307,22 +304,6 @@@ static int v4l2_release(struct inode *i
        return ret;
  }
  
 -static const struct file_operations v4l2_unlocked_fops = {
 -      .owner = THIS_MODULE,
 -      .read = v4l2_read,
 -      .write = v4l2_write,
 -      .open = v4l2_open,
 -      .get_unmapped_area = v4l2_get_unmapped_area,
 -      .mmap = v4l2_mmap,
 -      .unlocked_ioctl = v4l2_unlocked_ioctl,
 -#ifdef CONFIG_COMPAT
 -      .compat_ioctl = v4l2_compat_ioctl32,
 -#endif
 -      .release = v4l2_release,
 -      .poll = v4l2_poll,
 -      .llseek = no_llseek,
 -};
 -
  static const struct file_operations v4l2_fops = {
        .owner = THIS_MODULE,
        .read = v4l2_read,
        .open = v4l2_open,
        .get_unmapped_area = v4l2_get_unmapped_area,
        .mmap = v4l2_mmap,
 -      .ioctl = v4l2_ioctl,
 +      .unlocked_ioctl = v4l2_ioctl,
  #ifdef CONFIG_COMPAT
        .compat_ioctl = v4l2_compat_ioctl32,
  #endif
@@@ -391,7 -410,7 +391,7 @@@ static int __video_register_device(stru
        int minor_offset = 0;
        int minor_cnt = VIDEO_NUM_DEVICES;
        const char *name_base;
-       void *priv = video_get_drvdata(vdev);
+       void *priv = vdev->dev.p;
  
        /* A minor value of -1 marks this video device as never
           having been registered */
                ret = -ENOMEM;
                goto cleanup;
        }
 -      if (vdev->fops->unlocked_ioctl)
 -              vdev->cdev->ops = &v4l2_unlocked_fops;
 -      else
 -              vdev->cdev->ops = &v4l2_fops;
 +      vdev->cdev->ops = &v4l2_fops;
        vdev->cdev->owner = vdev->fops->owner;
        ret = cdev_add(vdev->cdev, MKDEV(VIDEO_MAJOR, vdev->minor), 1);
        if (ret < 0) {
  
        /* Part 4: register the device with sysfs */
        memset(&vdev->dev, 0, sizeof(vdev->dev));
-       /* The memset above cleared the device's drvdata, so
+       /* The memset above cleared the device's device_private, so
           put back the copy we made earlier. */
-       video_set_drvdata(vdev, priv);
+       vdev->dev.p = priv;
        vdev->dev.class = &video_class;
        vdev->dev.devt = MKDEV(VIDEO_MAJOR, vdev->minor);
        if (vdev->parent)
diff --combined fs/compat_ioctl.c
index 618f38136304ff5cb89e579643c8e4001fb57dba,63ae85831464a7741d89f7160e3cd93512332a4a..5d9b936c458baf9e138640aca5d216775e1c201c
@@@ -4,7 -4,7 +4,7 @@@
   * Copyright (C) 1997-2000  Jakub Jelinek  (jakub@redhat.com)
   * Copyright (C) 1998  Eddie C. Dost  (ecd@skynet.be)
   * Copyright (C) 2001,2002  Andi Kleen, SuSE Labs 
-  * Copyright (C) 2003       Pavel Machek (pavel@suse.cz)
+  * Copyright (C) 2003       Pavel Machek (pavel@ucw.cz)
   *
   * These routines maintain argument size conversion between 32bit and 64bit
   * ioctls.
@@@ -131,6 -131,23 +131,6 @@@ static int w_long(unsigned int fd, unsi
        return err;
  }
  
 -static int rw_long(unsigned int fd, unsigned int cmd,
 -              compat_ulong_t __user *argp)
 -{
 -      mm_segment_t old_fs = get_fs();
 -      int err;
 -      unsigned long val;
 -
 -      if(get_user(val, argp))
 -              return -EFAULT;
 -      set_fs (KERNEL_DS);
 -      err = sys_ioctl(fd, cmd, (unsigned long)&val);
 -      set_fs (old_fs);
 -      if (!err && put_user(val, argp))
 -              return -EFAULT;
 -      return err;
 -}
 -
  struct compat_video_event {
        int32_t         type;
        compat_time_t   timestamp;
@@@ -577,9 -594,18 +577,12 @@@ static int do_smb_getmountuid(unsigned 
        return err;
  }
  
 -static int ioc_settimeout(unsigned int fd, unsigned int cmd,
 -              compat_ulong_t __user *argp)
 -{
 -      return rw_long(fd, AUTOFS_IOC_SETTIMEOUT, argp);
 -}
 -
  /* Bluetooth ioctls */
- #define HCIUARTSETPROTO       _IOW('U', 200, int)
- #define HCIUARTGETPROTO       _IOR('U', 201, int)
+ #define HCIUARTSETPROTO               _IOW('U', 200, int)
+ #define HCIUARTGETPROTO               _IOR('U', 201, int)
+ #define HCIUARTGETDEVICE      _IOR('U', 202, int)
+ #define HCIUARTSETFLAGS               _IOW('U', 203, int)
+ #define HCIUARTGETFLAGS               _IOR('U', 204, int)
  
  #define BNEPCONNADD   _IOW('B', 200, int)
  #define BNEPCONNDEL   _IOW('B', 201, int)
@@@ -1258,6 -1284,13 +1261,6 @@@ COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5
  COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS)
  COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS)
  COMPATIBLE_IOCTL(OSS_GETVERSION)
 -/* AUTOFS */
 -COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC)
 -COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER)
 -COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
 -COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
 -COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER)
 -COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT)
  /* Raw devices */
  COMPATIBLE_IOCTL(RAW_SETBIND)
  COMPATIBLE_IOCTL(RAW_GETBIND)
@@@ -1298,6 -1331,8 +1301,8 @@@ COMPATIBLE_IOCTL(HCISETLINKPOL
  COMPATIBLE_IOCTL(HCISETLINKMODE)
  COMPATIBLE_IOCTL(HCISETACLMTU)
  COMPATIBLE_IOCTL(HCISETSCOMTU)
+ COMPATIBLE_IOCTL(HCIBLOCKADDR)
+ COMPATIBLE_IOCTL(HCIUNBLOCKADDR)
  COMPATIBLE_IOCTL(HCIINQUIRY)
  COMPATIBLE_IOCTL(HCIUARTSETPROTO)
  COMPATIBLE_IOCTL(HCIUARTGETPROTO)
@@@ -1522,6 -1557,9 +1527,6 @@@ static long do_ioctl_trans(int fd, unsi
        case RAW_GETBIND:
                return raw_ioctl(fd, cmd, argp);
  #endif
 -#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,unsigned int)
 -      case AUTOFS_IOC_SETTIMEOUT32:
 -              return ioc_settimeout(fd, cmd, argp);
        /* One SMB ioctl needs translations. */
  #define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t)
        case SMB_IOC_GETMOUNTUID_32:
        case KDSKBMETA:
        case KDSKBLED:
        case KDSETLED:
 -      /* AUTOFS */
 -      case AUTOFS_IOC_READY:
 -      case AUTOFS_IOC_FAIL:
        /* NBD */
        case NBD_SET_SOCK:
        case NBD_SET_BLKSIZE: