* [PATCH 1/2] staging: comedi: addi_apci_1564: remove check for timer subdevice
2014-05-07 7:02 [PATCH 0/2] staging: comedi: addi_apci_1564: remove boardinfo Chase Southwood
@ 2014-05-07 7:03 ` Chase Southwood
2014-05-07 7:04 ` [PATCH 2/2] staging: comedi: addi_apci_1564: remove boardinfo Chase Southwood
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Chase Southwood @ 2014-05-07 7:03 UTC (permalink / raw)
To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, 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.southwood@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@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 = 0xffffffff,
.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
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 2/2] staging: comedi: addi_apci_1564: remove boardinfo
2014-05-07 7:02 [PATCH 0/2] staging: comedi: addi_apci_1564: remove boardinfo Chase Southwood
2014-05-07 7:03 ` [PATCH 1/2] staging: comedi: addi_apci_1564: remove check for timer subdevice Chase Southwood
@ 2014-05-07 7:04 ` Chase Southwood
2014-05-07 9:08 ` [PATCH 0/2] " Ian Abbott
2014-05-07 15:56 ` Hartley Sweeten
3 siblings, 0 replies; 5+ messages in thread
From: Chase Southwood @ 2014-05-07 7:04 UTC (permalink / raw)
To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Chase Southwood
This driver only supports a single board type. Remove the boardinfo and
its use in the driver.
Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
---
drivers/staging/comedi/drivers/addi_apci_1564.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c
index d7a5c2f..cbccbb6 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -8,16 +8,6 @@
#include "addi-data/hwdrv_apci1564.c"
-static const struct addi_board apci1564_boardtypes[] = {
- {
- .pc_DriverName = "apci1564",
- .i_NbrDiChannel = 32,
- .i_NbrDoChannel = 32,
- .i_DoMaxdata = 0xffffffff,
- .i_Timer = 1,
- },
-};
-
static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
{
apci1564_interrupt(irq, d);
@@ -60,12 +50,11 @@ static int apci1564_auto_attach(struct comedi_device *dev,
unsigned long context_unused)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
- const struct addi_board *this_board = comedi_board(dev);
struct addi_private *devpriv;
struct comedi_subdevice *s;
int ret;
- dev->board_name = this_board->pc_DriverName;
+ dev->board_name = dev->driver->driver_name;
devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
if (!devpriv)
--
1.9.0
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 0/2] staging: comedi: addi_apci_1564: remove boardinfo
2014-05-07 7:02 [PATCH 0/2] staging: comedi: addi_apci_1564: remove boardinfo Chase Southwood
2014-05-07 7:03 ` [PATCH 1/2] staging: comedi: addi_apci_1564: remove check for timer subdevice Chase Southwood
2014-05-07 7:04 ` [PATCH 2/2] staging: comedi: addi_apci_1564: remove boardinfo Chase Southwood
@ 2014-05-07 9:08 ` Ian Abbott
2014-05-07 15:56 ` Hartley Sweeten
3 siblings, 0 replies; 5+ messages in thread
From: Ian Abbott @ 2014-05-07 9:08 UTC (permalink / raw)
To: Chase Southwood, gregkh; +Cc: hsweeten, devel, linux-kernel
On 2014/05/07 08:02 AM, Chase Southwood wrote:
> This patchset removes the last dependency on this driver's boardinfo (the
> timer subdevice init), and then removes the boardinfo from the driver.
>
> To be applied on top of my prior patchset "staging: comedi:
> addi_apci_1564: further cleanups"
>
> Chase Southwood (2):
> staging: comedi: addi_apci_1564: remove check for timer subdevice
> staging: comedi: addi_apci_1564: remove boardinfo
>
> drivers/staging/comedi/drivers/addi_apci_1564.c | 40 +++++++------------------
> 1 file changed, 10 insertions(+), 30 deletions(-)
>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 0/2] staging: comedi: addi_apci_1564: remove boardinfo
2014-05-07 7:02 [PATCH 0/2] staging: comedi: addi_apci_1564: remove boardinfo Chase Southwood
` (2 preceding siblings ...)
2014-05-07 9:08 ` [PATCH 0/2] " Ian Abbott
@ 2014-05-07 15:56 ` Hartley Sweeten
3 siblings, 0 replies; 5+ messages in thread
From: Hartley Sweeten @ 2014-05-07 15:56 UTC (permalink / raw)
To: Chase Southwood, gregkh; +Cc: abbotti, devel, linux-kernel
On Wednesday, May 07, 2014 12:03 AM, Chase Southwood wrote:
> This patchset removes the last dependency on this driver's boardinfo (the
> timer subdevice init), and then removes the boardinfo from the driver.
>
> To be applied on top of my prior patchset "staging: comedi:
> addi_apci_1564: further cleanups"
>
> Chase Southwood (2):
> staging: comedi: addi_apci_1564: remove check for timer subdevice
> staging: comedi: addi_apci_1564: remove boardinfo
>
> drivers/staging/comedi/drivers/addi_apci_1564.c | 40 +++++++------------------
> 1 file changed, 10 insertions(+), 30 deletions(-)
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
^ permalink raw reply [flat|nested] 5+ messages in thread