All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: comedi: cb_pcimdas: fix handlers for DI and DO subdevices
@ 2015-06-12 15:37 ` Ian Abbott
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Abbott @ 2015-06-12 15:37 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

Normally, low-level Comedi drivers set an `insn_bits` handler for
digital input (DI), digital output (DO) and digital input/output (DIO)
subdevice types to handle normal reading and writing of digital
channels.  The "cb_pcimdas" driver currently has an `insn_read` handler
for the DI subdevice and an `insn_write` handler for the DO subdevice.
However, the actual handler functions `cb_pcimdas_di_insn_read()` and
`cb_pcimdas_do_insn_write()` are written to behave like `insn_bits`
handlers.  Something's wrong there!  To fix it, set the functions as
`insn_bits` handlers and rename them for consistency.

Fixes: e56d03dee14a ("staging: comedi: cb_pcimdas: add main connector digital input/output")
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
I left the "Fixes:" line non-line-wrapped.  Is that the correct thing to
do?
---
 drivers/staging/comedi/drivers/cb_pcimdas.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcimdas.c b/drivers/staging/comedi/drivers/cb_pcimdas.c
index c458e50..4ebf5aa 100644
--- a/drivers/staging/comedi/drivers/cb_pcimdas.c
+++ b/drivers/staging/comedi/drivers/cb_pcimdas.c
@@ -243,7 +243,7 @@ static int cb_pcimdas_ao_insn_write(struct comedi_device *dev,
 	return insn->n;
 }
 
-static int cb_pcimdas_di_insn_read(struct comedi_device *dev,
+static int cb_pcimdas_di_insn_bits(struct comedi_device *dev,
 				   struct comedi_subdevice *s,
 				   struct comedi_insn *insn,
 				   unsigned int *data)
@@ -258,7 +258,7 @@ static int cb_pcimdas_di_insn_read(struct comedi_device *dev,
 	return insn->n;
 }
 
-static int cb_pcimdas_do_insn_write(struct comedi_device *dev,
+static int cb_pcimdas_do_insn_bits(struct comedi_device *dev,
 				    struct comedi_subdevice *s,
 				    struct comedi_insn *insn,
 				    unsigned int *data)
@@ -424,7 +424,7 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
 	s->n_chan	= 4;
 	s->maxdata	= 1;
 	s->range_table	= &range_digital;
-	s->insn_read	= cb_pcimdas_di_insn_read;
+	s->insn_bits	= cb_pcimdas_di_insn_bits;
 
 	/* Digital Output subdevice (main connector) */
 	s = &dev->subdevices[4];
@@ -433,7 +433,7 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
 	s->n_chan	= 4;
 	s->maxdata	= 1;
 	s->range_table	= &range_digital;
-	s->insn_write	= cb_pcimdas_do_insn_write;
+	s->insn_bits	= cb_pcimdas_do_insn_bits;
 
 	/* Counter subdevice (8254) */
 	s = &dev->subdevices[5];
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] staging: comedi: cb_pcimdas: fix handlers for DI and DO subdevices
@ 2015-06-12 15:37 ` Ian Abbott
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Abbott @ 2015-06-12 15:37 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

Normally, low-level Comedi drivers set an `insn_bits` handler for
digital input (DI), digital output (DO) and digital input/output (DIO)
subdevice types to handle normal reading and writing of digital
channels.  The "cb_pcimdas" driver currently has an `insn_read` handler
for the DI subdevice and an `insn_write` handler for the DO subdevice.
However, the actual handler functions `cb_pcimdas_di_insn_read()` and
`cb_pcimdas_do_insn_write()` are written to behave like `insn_bits`
handlers.  Something's wrong there!  To fix it, set the functions as
`insn_bits` handlers and rename them for consistency.

Fixes: e56d03dee14a ("staging: comedi: cb_pcimdas: add main connector digital input/output")
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
I left the "Fixes:" line non-line-wrapped.  Is that the correct thing to
do?
---
 drivers/staging/comedi/drivers/cb_pcimdas.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcimdas.c b/drivers/staging/comedi/drivers/cb_pcimdas.c
index c458e50..4ebf5aa 100644
--- a/drivers/staging/comedi/drivers/cb_pcimdas.c
+++ b/drivers/staging/comedi/drivers/cb_pcimdas.c
@@ -243,7 +243,7 @@ static int cb_pcimdas_ao_insn_write(struct comedi_device *dev,
 	return insn->n;
 }
 
-static int cb_pcimdas_di_insn_read(struct comedi_device *dev,
+static int cb_pcimdas_di_insn_bits(struct comedi_device *dev,
 				   struct comedi_subdevice *s,
 				   struct comedi_insn *insn,
 				   unsigned int *data)
@@ -258,7 +258,7 @@ static int cb_pcimdas_di_insn_read(struct comedi_device *dev,
 	return insn->n;
 }
 
-static int cb_pcimdas_do_insn_write(struct comedi_device *dev,
+static int cb_pcimdas_do_insn_bits(struct comedi_device *dev,
 				    struct comedi_subdevice *s,
 				    struct comedi_insn *insn,
 				    unsigned int *data)
@@ -424,7 +424,7 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
 	s->n_chan	= 4;
 	s->maxdata	= 1;
 	s->range_table	= &range_digital;
-	s->insn_read	= cb_pcimdas_di_insn_read;
+	s->insn_bits	= cb_pcimdas_di_insn_bits;
 
 	/* Digital Output subdevice (main connector) */
 	s = &dev->subdevices[4];
@@ -433,7 +433,7 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
 	s->n_chan	= 4;
 	s->maxdata	= 1;
 	s->range_table	= &range_digital;
-	s->insn_write	= cb_pcimdas_do_insn_write;
+	s->insn_bits	= cb_pcimdas_do_insn_bits;
 
 	/* Counter subdevice (8254) */
 	s = &dev->subdevices[5];
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: comedi: cb_pcimdas: fix handlers for DI and DO subdevices
  2015-06-12 15:37 ` Ian Abbott
@ 2015-06-13  0:05   ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-06-13  0:05 UTC (permalink / raw)
  To: Ian Abbott; +Cc: driverdev-devel, H Hartley Sweeten, linux-kernel

On Fri, Jun 12, 2015 at 04:37:41PM +0100, Ian Abbott wrote:
> Normally, low-level Comedi drivers set an `insn_bits` handler for
> digital input (DI), digital output (DO) and digital input/output (DIO)
> subdevice types to handle normal reading and writing of digital
> channels.  The "cb_pcimdas" driver currently has an `insn_read` handler
> for the DI subdevice and an `insn_write` handler for the DO subdevice.
> However, the actual handler functions `cb_pcimdas_di_insn_read()` and
> `cb_pcimdas_do_insn_write()` are written to behave like `insn_bits`
> handlers.  Something's wrong there!  To fix it, set the functions as
> `insn_bits` handlers and rename them for consistency.
> 
> Fixes: e56d03dee14a ("staging: comedi: cb_pcimdas: add main connector digital input/output")
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
> I left the "Fixes:" line non-line-wrapped.  Is that the correct thing to
> do?

Sure, that's fine, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: comedi: cb_pcimdas: fix handlers for DI and DO subdevices
@ 2015-06-13  0:05   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-06-13  0:05 UTC (permalink / raw)
  To: Ian Abbott; +Cc: H Hartley Sweeten, driverdev-devel, linux-kernel

On Fri, Jun 12, 2015 at 04:37:41PM +0100, Ian Abbott wrote:
> Normally, low-level Comedi drivers set an `insn_bits` handler for
> digital input (DI), digital output (DO) and digital input/output (DIO)
> subdevice types to handle normal reading and writing of digital
> channels.  The "cb_pcimdas" driver currently has an `insn_read` handler
> for the DI subdevice and an `insn_write` handler for the DO subdevice.
> However, the actual handler functions `cb_pcimdas_di_insn_read()` and
> `cb_pcimdas_do_insn_write()` are written to behave like `insn_bits`
> handlers.  Something's wrong there!  To fix it, set the functions as
> `insn_bits` handlers and rename them for consistency.
> 
> Fixes: e56d03dee14a ("staging: comedi: cb_pcimdas: add main connector digital input/output")
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
> I left the "Fixes:" line non-line-wrapped.  Is that the correct thing to
> do?

Sure, that's fine, thanks.

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-13  0:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-12 15:37 [PATCH] staging: comedi: cb_pcimdas: fix handlers for DI and DO subdevices Ian Abbott
2015-06-12 15:37 ` Ian Abbott
2015-06-13  0:05 ` Greg Kroah-Hartman
2015-06-13  0:05   ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.