staging: comedi: cb_das16_cs: cleanup dio subdevice initialization
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.
Signed-off-by H Hartley Sweeten <[email protected]>
Cc Ian Abbott <[email protected]>
Cc Frank Mori Hess <[email protected]>
Signed-off-by Greg Kroah-Hartman <[email protected]>
--- 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
@@ -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
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.
Signed-off-by H Hartley Sweeten <[email protected]>Cc Ian Abbott <[email protected]>Cc Frank Mori Hess <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
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
[email protected]
maintainerQuoted 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.
Signed-off-by H Hartley Sweeten <[email protected]>Cc Ian Abbott <[email protected]>Cc Frank Mori Hess <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
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.