[PATCH 1/2] staging: comedi: addi_apci_1564: remove check for timer subdevice

2014-05-07 Thread Chase Southwood
The only board served by this driver always has a timer, so we can init
the timer subdevice without checking first.

The boardinfo about the timer can also be removed and the data used
directly.

Signed-off-by: Chase Southwood 
Cc: Ian Abbott 
Cc: H Hartley Sweeten 
---
 drivers/staging/comedi/drivers/addi_apci_1564.c | 27 +
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c 
b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 86276cd..d7a5c2f 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -15,9 +15,6 @@ static const struct addi_board apci1564_boardtypes[] = {
.i_NbrDoChannel = 32,
.i_DoMaxdata= 0x,
.i_Timer= 1,
-   .timer_config   = apci1564_timer_config,
-   .timer_write= apci1564_timer_write,
-   .timer_read = apci1564_timer_read,
},
 };
 
@@ -119,21 +116,15 @@ static int apci1564_auto_attach(struct comedi_device *dev,
 
/*  Allocate and Initialise Timer Subdevice Structures */
s = >subdevices[2];
-   if (this_board->i_Timer) {
-   s->type = COMEDI_SUBD_TIMER;
-   s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
-   s->n_chan = 1;
-   s->maxdata = 0;
-   s->len_chanlist = 1;
-   s->range_table = _digital;
-
-   s->insn_write = this_board->timer_write;
-   s->insn_read = this_board->timer_read;
-   s->insn_config = this_board->timer_config;
-   s->insn_bits = this_board->timer_bits;
-   } else {
-   s->type = COMEDI_SUBD_UNUSED;
-   }
+   s->type = COMEDI_SUBD_TIMER;
+   s->subdev_flags = SDF_WRITEABLE;
+   s->n_chan = 1;
+   s->maxdata = 0;
+   s->len_chanlist = 1;
+   s->range_table = _digital;
+   s->insn_write = apci1564_timer_write;
+   s->insn_read = apci1564_timer_read;
+   s->insn_config = apci1564_timer_config;
 
return 0;
 }
-- 
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] staging: comedi: addi_apci_1564: remove check for timer subdevice

2014-05-07 Thread Chase Southwood
The only board served by this driver always has a timer, so we can init
the timer subdevice without checking first.

The boardinfo about the timer can also be removed and the data used
directly.

Signed-off-by: Chase Southwood chase.southw...@gmail.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: H Hartley Sweeten hswee...@visionengravers.com
---
 drivers/staging/comedi/drivers/addi_apci_1564.c | 27 +
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c 
b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 86276cd..d7a5c2f 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -15,9 +15,6 @@ static const struct addi_board apci1564_boardtypes[] = {
.i_NbrDoChannel = 32,
.i_DoMaxdata= 0x,
.i_Timer= 1,
-   .timer_config   = apci1564_timer_config,
-   .timer_write= apci1564_timer_write,
-   .timer_read = apci1564_timer_read,
},
 };
 
@@ -119,21 +116,15 @@ static int apci1564_auto_attach(struct comedi_device *dev,
 
/*  Allocate and Initialise Timer Subdevice Structures */
s = dev-subdevices[2];
-   if (this_board-i_Timer) {
-   s-type = COMEDI_SUBD_TIMER;
-   s-subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
-   s-n_chan = 1;
-   s-maxdata = 0;
-   s-len_chanlist = 1;
-   s-range_table = range_digital;
-
-   s-insn_write = this_board-timer_write;
-   s-insn_read = this_board-timer_read;
-   s-insn_config = this_board-timer_config;
-   s-insn_bits = this_board-timer_bits;
-   } else {
-   s-type = COMEDI_SUBD_UNUSED;
-   }
+   s-type = COMEDI_SUBD_TIMER;
+   s-subdev_flags = SDF_WRITEABLE;
+   s-n_chan = 1;
+   s-maxdata = 0;
+   s-len_chanlist = 1;
+   s-range_table = range_digital;
+   s-insn_write = apci1564_timer_write;
+   s-insn_read = apci1564_timer_read;
+   s-insn_config = apci1564_timer_config;
 
return 0;
 }
-- 
1.9.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/