From: H Hartley Sweeten Date: Wed, 19 Dec 2012 22:44:46 +0000 (-0700) Subject: staging: comedi: comedi_fops: cleanup comedi_{read, write}_subdevice() X-Git-Tag: upstream/snapshot3+hdmi~5696^2~516 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=401d99de5c0b70f7d64a410ed01d19032698656c;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git staging: comedi: comedi_fops: cleanup comedi_{read, write}_subdevice() Flip the info->device tests so than the return NULL occurs last. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 33f5187..8d407cc 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -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,