Skip to content

Commit

Permalink
staging: comedi: comedi_fops: cleanup comedi_{read, write}_subdevice()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent 9682e28 commit 401d99d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,19 @@ 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 *
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,
Expand Down

0 comments on commit 401d99d

Please sign in to comment.