summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorH Hartley Sweeten2012-12-19 23:39:18 +0100
committerGreg Kroah-Hartman2013-01-07 23:25:47 +0100
commit0e700923bf63b4afb7bb213f140d5a6e28c32aa6 (patch)
tree7f9ce92444b890a8e55cf61a39ce2d0c5bb5a960 /drivers/staging/comedi/comedi_fops.c
parentstaging: comedi: comedi_fops: rename comedi_{read,write}_subdevice() (diff)
downloadkernel-qcow2-linux-0e700923bf63b4afb7bb213f140d5a6e28c32aa6.tar.gz
kernel-qcow2-linux-0e700923bf63b4afb7bb213f140d5a6e28c32aa6.tar.xz
kernel-qcow2-linux-0e700923bf63b4afb7bb213f140d5a6e28c32aa6.zip
staging: comedi: comedi_fops: cleanup do_devinfo_ioctl()
Consolidate the local variables 'read_subdev' and 'write_subdev' into a single local variable 's'. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r--drivers/staging/comedi/comedi_fops.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index a480b6ee5770..f67b12a7b847 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -580,11 +580,10 @@ static int do_devinfo_ioctl(struct comedi_device *dev,
struct comedi_devinfo __user *arg,
struct file *file)
{
- struct comedi_devinfo devinfo;
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_file_info *info = comedi_file_info_from_minor(minor);
- struct comedi_subdevice *read_subdev = comedi_read_subdevice(info);
- struct comedi_subdevice *write_subdev = comedi_write_subdevice(info);
+ struct comedi_subdevice *s;
+ struct comedi_devinfo devinfo;
memset(&devinfo, 0, sizeof(devinfo));
@@ -594,13 +593,15 @@ static int do_devinfo_ioctl(struct comedi_device *dev,
strlcpy(devinfo.driver_name, dev->driver->driver_name, COMEDI_NAMELEN);
strlcpy(devinfo.board_name, dev->board_name, COMEDI_NAMELEN);
- if (read_subdev)
- devinfo.read_subdevice = read_subdev - dev->subdevices;
+ s = comedi_read_subdevice(info);
+ if (s)
+ devinfo.read_subdevice = s - dev->subdevices;
else
devinfo.read_subdevice = -1;
- if (write_subdev)
- devinfo.write_subdevice = write_subdev - dev->subdevices;
+ s = comedi_write_subdevice(info);
+ if (s)
+ devinfo.write_subdevice = s - dev->subdevices;
else
devinfo.write_subdevice = -1;