* [PATCH 0/4] staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach()
@ 2014-07-11 4:00 Chase Southwood
2014-07-11 4:01 ` [PATCH 1/4] staging: comedi: addi_apci_1564: remove len_chanlist from di and do subdevices Chase Southwood
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Chase Southwood @ 2014-07-11 4:00 UTC (permalink / raw)
To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, 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: 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(-)
--
2.0.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] staging: comedi: addi_apci_1564: remove len_chanlist from di and do subdevices
2014-07-11 4:00 [PATCH 0/4] staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach() Chase Southwood
@ 2014-07-11 4:01 ` Chase Southwood
2014-07-11 4:02 ` [PATCH 2/4] staging: comedi: addi_apci_1564: remove unnecessary dev->board_name initialization Chase Southwood
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Chase Southwood @ 2014-07-11 4:01 UTC (permalink / raw)
To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Chase Southwood
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.
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 | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 5924421..675054f 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -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;
--
2.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] staging: comedi: addi_apci_1564: remove unnecessary dev->board_name initialization
2014-07-11 4:00 [PATCH 0/4] staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach() Chase Southwood
2014-07-11 4:01 ` [PATCH 1/4] staging: comedi: addi_apci_1564: remove len_chanlist from di and do subdevices Chase Southwood
@ 2014-07-11 4:02 ` Chase Southwood
2014-07-11 4:02 ` [PATCH 3/4] staging: comedi: addi_apci_1564: remove null check of devpriv in apci1564_detach() Chase Southwood
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Chase Southwood @ 2014-07-11 4:02 UTC (permalink / raw)
To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Chase Southwood
The 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.
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 | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 675054f..e3dcab7 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -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;
--
2.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] staging: comedi: addi_apci_1564: remove null check of devpriv in apci1564_detach()
2014-07-11 4:00 [PATCH 0/4] staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach() Chase Southwood
2014-07-11 4:01 ` [PATCH 1/4] staging: comedi: addi_apci_1564: remove len_chanlist from di and do subdevices Chase Southwood
2014-07-11 4:02 ` [PATCH 2/4] staging: comedi: addi_apci_1564: remove unnecessary dev->board_name initialization Chase Southwood
@ 2014-07-11 4:02 ` Chase Southwood
2014-07-11 4:02 ` [PATCH 4/4] staging: comedi: addi_apci_1564: fix s->maxdata assignment in do subdevice init Chase Southwood
2014-07-11 10:24 ` [PATCH 0/4] staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach() Ian Abbott
4 siblings, 0 replies; 6+ messages in thread
From: Chase Southwood @ 2014-07-11 4:02 UTC (permalink / raw)
To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Chase Southwood
There is no need to test whether devpriv is null in this function. The
check looks left over and we can just remove it.
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 | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c
index e3dcab7..f91aedd 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -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);
}
--
2.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] staging: comedi: addi_apci_1564: fix s->maxdata assignment in do subdevice init.
2014-07-11 4:00 [PATCH 0/4] staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach() Chase Southwood
` (2 preceding siblings ...)
2014-07-11 4:02 ` [PATCH 3/4] staging: comedi: addi_apci_1564: remove null check of devpriv in apci1564_detach() Chase Southwood
@ 2014-07-11 4:02 ` Chase Southwood
2014-07-11 10:24 ` [PATCH 0/4] staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach() Ian Abbott
4 siblings, 0 replies; 6+ messages in thread
From: Chase Southwood @ 2014-07-11 4:02 UTC (permalink / raw)
To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Chase Southwood
s->maxdata for the do subdevice should be 1, however currently it is
being set to 0xffffffff. Fix this.
Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
---
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(-)
diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c
index f91aedd..1e25342 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -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;
--
2.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach()
2014-07-11 4:00 [PATCH 0/4] staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach() Chase Southwood
` (3 preceding siblings ...)
2014-07-11 4:02 ` [PATCH 4/4] staging: comedi: addi_apci_1564: fix s->maxdata assignment in do subdevice init Chase Southwood
@ 2014-07-11 10:24 ` Ian Abbott
4 siblings, 0 replies; 6+ messages in thread
From: Ian Abbott @ 2014-07-11 10:24 UTC (permalink / raw)
To: Chase Southwood, gregkh; +Cc: hsweeten, devel, linux-kernel
On 2014-07-11 05:00, Chase Southwood wrote:
> 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(-)
>
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] 6+ messages in thread
end of thread, other threads:[~2014-07-11 10:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 4:00 [PATCH 0/4] staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach() Chase Southwood
2014-07-11 4:01 ` [PATCH 1/4] staging: comedi: addi_apci_1564: remove len_chanlist from di and do subdevices Chase Southwood
2014-07-11 4:02 ` [PATCH 2/4] staging: comedi: addi_apci_1564: remove unnecessary dev->board_name initialization Chase Southwood
2014-07-11 4:02 ` [PATCH 3/4] staging: comedi: addi_apci_1564: remove null check of devpriv in apci1564_detach() Chase Southwood
2014-07-11 4:02 ` [PATCH 4/4] staging: comedi: addi_apci_1564: fix s->maxdata assignment in do subdevice init Chase Southwood
2014-07-11 10:24 ` [PATCH 0/4] staging: comedi: addi_apci_1564: small fixes in apci1564_auto_attach() and apci1564_detach() Ian Abbott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox