Skip to contentSkip to conversation

staging: comedi: cb_das16_cs: cleanup dio subdevice initialization

PATCH In review H Hartley Sweeten 2 participants 3 messages Jun 26, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 19/33 staging: comedi: cb_das16_cs: cleanup dio subdevice initialization

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

---
 drivers/staging/comedi/drivers/cb_das16_cs.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
drivers/staging/comedi/drivers/cb_das16_cs.c +7 -11
index b0a2223..f3d5ca0 100644
@@ -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;
 }
Signature · 1 line
1.7.11
#1 lore raw
Quoted 7 lines · H Hartley Sweeten

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

Grr... Did it again.

Sorry Greg. That should be a Cc not a Signed-off-by. Do you want me to repost these?

Regards,
Hartley

#2 lore raw
Quoted 9 lines · H Hartley Sweeten
Quoted 7 lines · H Hartley Sweeten

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

Quoted 4 lines

Grr... Did it again.

Sorry Greg. That should be a Cc not a Signed-off-by. Do you want me to repost these?

No problem, I'll edit it out.