staging: comedi: comedi_fops: cleanup comedi_{read, write}_subdevice()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 19 Dec 2012 22:44:46 +0000 (15:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2013 22:25:49 +0000 (14:25 -0800)
Flip the info->device tests so than the return NULL occurs last.

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>
drivers/staging/comedi/comedi_fops.c

index 33f5187e49db86ea55e57ffae621f0ce40b89b55..8d407ccd4ed4992daef366a3c539098598a23efd 100644 (file)
@@ -118,9 +118,9 @@ comedi_read_subdevice(const struct comedi_file_info *info)
 {
        if (info->read_subdevice)
                return info->read_subdevice;
-       if (info->device == NULL)
-               return NULL;
-       return info->device->read_subdev;
+       if (info->device)
+               return info->device->read_subdev;
+       return NULL;
 }
 
 static struct comedi_subdevice *
@@ -128,9 +128,9 @@ comedi_write_subdevice(const struct comedi_file_info *info)
 {
        if (info->write_subdevice)
                return info->write_subdevice;
-       if (info->device == NULL)
-               return NULL;
-       return info->device->write_subdev;
+       if (info->device)
+               return info->device->write_subdev;
+       return NULL;
 }
 
 static int resize_async_buffer(struct comedi_device *dev,