public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 19/33] staging: comedi: cb_das16_cs: cleanup dio subdevice initialization
@ 2012-06-26  0:00 H Hartley Sweeten
  2012-06-26  0:09 ` H Hartley Sweeten
  0 siblings, 1 reply; 3+ messages in thread
From: H Hartley Sweeten @ 2012-06-26  0:00 UTC (permalink / raw)
  To: Linux Kernel; +Cc: devel, abbotti, fmhess, gregkh

The digital i/o subdevice is always initialized due to the 'if (1)'.
Simplify the attach by removing the test.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/comedi/drivers/cb_das16_cs.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c
index b0a2223..f3d5ca0 100644
--- a/drivers/staging/comedi/drivers/cb_das16_cs.c
+++ b/drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -513,17 +513,13 @@ static int das16cs_attach(struct comedi_device *dev,
 
 	s = dev->subdevices + 2;
 	/* digital i/o subdevice */
-	if (1) {
-		s->type = COMEDI_SUBD_DIO;
-		s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
-		s->n_chan = 8;
-		s->maxdata = 1;
-		s->range_table = &range_digital;
-		s->insn_bits = das16cs_dio_insn_bits;
-		s->insn_config = das16cs_dio_insn_config;
-	} else {
-		s->type = COMEDI_SUBD_UNUSED;
-	}
+	s->type = COMEDI_SUBD_DIO;
+	s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
+	s->n_chan = 8;
+	s->maxdata = 1;
+	s->range_table = &range_digital;
+	s->insn_bits = das16cs_dio_insn_bits;
+	s->insn_config = das16cs_dio_insn_config;
 
 	return 1;
 }
-- 
1.7.11


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-26  0:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-26  0:00 [PATCH 19/33] staging: comedi: cb_das16_cs: cleanup dio subdevice initialization H Hartley Sweeten
2012-06-26  0:09 ` H Hartley Sweeten
2012-06-26  0:24   ` gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox