staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach()
cover staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach()
This is a small patchset containing a handful of fixes to the ADDI-DATA APCI1564 driver that I would like to get out of the way before I forget to take care of them. From here, I will move to start fixing the digital input/timer/counters/watchdog functionality of the board.
Chase Southwood (4):
staging: comedi: addi_apci_1564: remove len_chanlist from di and do
subdevices
staging: comedi: addi_apci_1564: remove unnecessary dev->board_name
initialization
staging: comedi: addi_apci_1564: remove null check of devpriv in
apci1564_detach()
staging: comedi: addi_apci_1564: fix s->maxdata assignment in do
subdevice init.
drivers/staging/comedi/drivers/addi_apci_1564.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-)
Signature · 1 line
2.0.1
PATCH 1/4 staging: comedi: addi_apci_1564: remove len_chanlist from di and do subdevices
This value is only needed for subdevices that support async commands. The comedi core will default the value to 1 when it is not initialized.
--- drivers/staging/comedi/drivers/addi_apci_1564.c | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/comedi/drivers/addi_apci_1564.c +0 -2
@@ -385,7 +385,6 @@ static int apci1564_auto_attach(struct comedi_device *dev, s->subdev_flags =SDF_READABLE ; s->n_chan =32 ; s->maxdata =1 ; - s->len_chanlist =32 ; s->range_table = &range_digital; s->insn_bits = apci1564_di_insn_bits;
@@ -395,7 +394,6 @@ static int apci1564_auto_attach(struct comedi_device *dev, s->subdev_flags =SDF_WRITEABLE ; s->n_chan =32 ; s->maxdata =0xffffffff ; - s->len_chanlist =32 ; s->range_table = &range_digital; s->insn_config = apci1564_do_config; s->insn_bits = apci1564_do_insn_bits;
Signature · 1 line
2.0.1
PATCH 2/4 staging: comedi: addi_apci_1564: remove unnecessary dev->board_name initialization
In reply to Chase SouthwoodThe dev->board_name is now initialized by the comedi core before calling the(*attach) or (*auto_attach) function in a driver. As long as the driver does no additional probing, it's no longer necessary initialize the board_name.
--- drivers/staging/comedi/drivers/addi_apci_1564.c | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/comedi/drivers/addi_apci_1564.c +0 -2
@@ -353,8 +353,6 @@ static int apci1564_auto_attach(struct comedi_device *dev,struct comedi_subdevice *s;int ret; - dev->board_name = dev->driver->driver_name; - devpriv =comedi_alloc_devpriv (dev,sizeof (*devpriv));if (!devpriv)return -ENOMEM ;
Signature · 1 line
2.0.1
PATCH 3/4 staging: comedi: addi_apci_1564: remove null check of devpriv in apci1564_detach()
In reply to Chase SouthwoodThere is no need to test whether devpriv is null in this function. The check looks left over and we can just remove it.
--- drivers/staging/comedi/drivers/addi_apci_1564.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/staging/comedi/drivers/addi_apci_1564.c +4 -8
@@ -433,14 +433,10 @@ static int apci1564_auto_attach(struct comedi_device *dev,static void apci1564_detach (struct comedi_device *dev) { -struct apci1564_private *devpriv = dev->private; - -if (devpriv) { -if (dev->iobase) -apci1564_reset (dev); -if (dev->irq) -free_irq (dev->irq, dev); - } +if (dev->iobase) +apci1564_reset (dev); +if (dev->irq) +free_irq (dev->irq, dev);comedi_pci_disable (dev); }
Signature · 1 line
2.0.1
PATCH 4/4 staging: comedi: addi_apci_1564: fix s->maxdata assignment in do subdevice init.
In reply to Chase Southwoods->maxdata for the do subdevice should be 1, however currently it is being set to 0xffffffff. Fix this.
---
This patch is at the end because I'm somewhat uncertain of its correctness. Every other addi_apci_* driver with a digital output subdevice sets s->maxdata to 1 so I'd be surprised if just this board differed, but I'm not familiar enough with the hardware to verify that myself. I'd appreciate a verification that this is a correct change. Thanks!
drivers/staging/comedi/drivers/addi_apci_1564.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/addi_apci_1564.c +1 -1
@@ -391,7 +391,7 @@ static int apci1564_auto_attach(struct comedi_device *dev, s->type =COMEDI_SUBD_DO ; s->subdev_flags =SDF_WRITEABLE ; s->n_chan =32 ; - s->maxdata =0xffffffff ; + s->maxdata =1 ; s->range_table = &range_digital; s->insn_config = apci1564_do_config; s->insn_bits = apci1564_do_insn_bits;
Signature · 1 line
2.0.1
Quoted 11 lines · Chase Southwood
This is a small patchset containing a handful of fixes to the ADDI-DATA APCI1564 driver that I would like to get out of the way before I forget to take care of them. From here, I will move to start fixing the digital input/timer/counters/watchdog functionality of the board.
Chase Southwood (4):
staging: comedi:addi_apci_1564: removelen_chanlistfrom di and do
subdevices
staging: comedi:addi_apci_1564: remove unnecessarydev->board_name
initialization
staging: comedi:addi_apci_1564: remove null check of devpriv in
Quoted 7 lines
apci1564_detach()staging: comedi:
addi_apci_1564: fixs->maxdataassignment in do
subdevice init.drivers/staging/comedi/drivers/addi_apci_1564.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-)
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-