All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] staging: comedi: move comedi_fc functionality into core
@ 2014-09-15 12:45 ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:45 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

The "comedi_fc" module contains a few functions for use by several
low-level comedi drivers.  Since they are used by quite a few drivers,
it seems useful to migrate their functionality to the core "comedi"
module, renaming them in the process, while keeping the original
function names in "drivers/comedi_fc.h" available for now.  This set of
patches accomplishes that.

The next stages after this will be to migrate the remaining inline
functions from "drivers/comedi_fc.h" (possibly making them externally
exported functions, although they are rather short), and then to update
the low-level drivers to call the functions with the new names,
eliminating the need to include "comedi_fc.h".  Then
"drivers/comedi_fc.h" can be removed as well.

Note that PATCH 10 has a couple of checkpatch warnings due to
changing an existing block comment in non-standard block-comment style.

PATCH 11 has a checkpatch warning to check whether MAINTAINERS needs
updating.  It doesn't.

PATCH 11 might conflict with some other patch series that haven't been
committed yet.

01) staging: comedi: add comedi_bytes_per_scan()
02) staging: comedi: comedi_fc: use comedi_bytes_per_scan()
03) staging: comedi: add comedi_inc_scan_progress()
04) staging: comedi: comedi_fc: use comedi_inc_scan_progress()
05) staging: comedi: add comedi_handle_events()
06) staging: comedi: comedi_fc: cfc_write_array_to_buffer() data is
    const
07) staging: comedi: add comedi_write_array_to_buffer()
08) staging: comedi: comedi_fc.h: use comedi_write_array_to_buffer()
09) staging: comedi: add comedi_read_array_from_buffer()
10) staging: comedi: migrate copyrights from "comedi_fc.c"
11) staging: comedi: remove comedi_fc module

 drivers/staging/comedi/Kconfig             |  31 -------
 drivers/staging/comedi/comedi_buf.c        |  66 +++++++++++++++
 drivers/staging/comedi/comedidev.h         |  11 +++
 drivers/staging/comedi/drivers.c           |  95 +++++++++++++++++++++
 drivers/staging/comedi/drivers/Makefile    |   1 -
 drivers/staging/comedi/drivers/comedi_fc.c | 132 -----------------------------
 drivers/staging/comedi/drivers/comedi_fc.h |  40 ++++++---
 7 files changed, 201 insertions(+), 175 deletions(-)

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

* [PATCH 00/11] staging: comedi: move comedi_fc functionality into core
@ 2014-09-15 12:45 ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:45 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Greg Kroah-Hartman, Ian Abbott, linux-kernel

The "comedi_fc" module contains a few functions for use by several
low-level comedi drivers.  Since they are used by quite a few drivers,
it seems useful to migrate their functionality to the core "comedi"
module, renaming them in the process, while keeping the original
function names in "drivers/comedi_fc.h" available for now.  This set of
patches accomplishes that.

The next stages after this will be to migrate the remaining inline
functions from "drivers/comedi_fc.h" (possibly making them externally
exported functions, although they are rather short), and then to update
the low-level drivers to call the functions with the new names,
eliminating the need to include "comedi_fc.h".  Then
"drivers/comedi_fc.h" can be removed as well.

Note that PATCH 10 has a couple of checkpatch warnings due to
changing an existing block comment in non-standard block-comment style.

PATCH 11 has a checkpatch warning to check whether MAINTAINERS needs
updating.  It doesn't.

PATCH 11 might conflict with some other patch series that haven't been
committed yet.

01) staging: comedi: add comedi_bytes_per_scan()
02) staging: comedi: comedi_fc: use comedi_bytes_per_scan()
03) staging: comedi: add comedi_inc_scan_progress()
04) staging: comedi: comedi_fc: use comedi_inc_scan_progress()
05) staging: comedi: add comedi_handle_events()
06) staging: comedi: comedi_fc: cfc_write_array_to_buffer() data is
    const
07) staging: comedi: add comedi_write_array_to_buffer()
08) staging: comedi: comedi_fc.h: use comedi_write_array_to_buffer()
09) staging: comedi: add comedi_read_array_from_buffer()
10) staging: comedi: migrate copyrights from "comedi_fc.c"
11) staging: comedi: remove comedi_fc module

 drivers/staging/comedi/Kconfig             |  31 -------
 drivers/staging/comedi/comedi_buf.c        |  66 +++++++++++++++
 drivers/staging/comedi/comedidev.h         |  11 +++
 drivers/staging/comedi/drivers.c           |  95 +++++++++++++++++++++
 drivers/staging/comedi/drivers/Makefile    |   1 -
 drivers/staging/comedi/drivers/comedi_fc.c | 132 -----------------------------
 drivers/staging/comedi/drivers/comedi_fc.h |  40 ++++++---
 7 files changed, 201 insertions(+), 175 deletions(-)
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 01/11] staging: comedi: add comedi_bytes_per_scan()
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 12:45   ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:45 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

The "comedi_fc" module contains a few functions useful to Comedi
drivers.  Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`.  As part of this
migration, move `cfc_bytes_per_scan()` into the core comedi module and
rename it to `comedi_bytes_per_scan()`.  Change the external declaration
of `cfc_bytes_per_scan()` into an inline function that calls
`comedi_bytes_per_scan()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/comedidev.h         |  1 +
 drivers/staging/comedi/drivers.c           | 37 ++++++++++++++++++++++++++++++
 drivers/staging/comedi/drivers/comedi_fc.c | 22 ------------------
 drivers/staging/comedi/drivers/comedi_fc.h |  6 ++++-
 4 files changed, 43 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index bda5304..1c69509 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -447,6 +447,7 @@ int comedi_dio_insn_config(struct comedi_device *, struct comedi_subdevice *,
 			   unsigned int mask);
 unsigned int comedi_dio_update_state(struct comedi_subdevice *,
 				     unsigned int *data);
+unsigned int comedi_bytes_per_scan(struct comedi_subdevice *s);
 
 void *comedi_alloc_devpriv(struct comedi_device *, size_t);
 int comedi_alloc_subdevices(struct comedi_device *, int);
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index c4ed8fd..891c092 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -290,6 +290,43 @@ unsigned int comedi_dio_update_state(struct comedi_subdevice *s,
 }
 EXPORT_SYMBOL_GPL(comedi_dio_update_state);
 
+/**
+ * comedi_bytes_per_scan - get length of asynchronous command "scan" in bytes
+ * @s: comedi_subdevice struct
+ *
+ * Determines the overall scan length according to the subdevice type and the
+ * number of channels in the scan.
+ *
+ * For digital input, output or input/output subdevices, samples for multiple
+ * channels are assumed to be packed into one or more unsigned short or
+ * unsigned int values according to the subdevice's SDF_LSAMPL flag.  For other
+ * types of subdevice, samples are assumed to occupy a whole unsigned short or
+ * unsigned int according to the SDF_LSAMPL flag.
+ *
+ * Returns the overall scan length in bytes.
+ */
+unsigned int comedi_bytes_per_scan(struct comedi_subdevice *s)
+{
+	struct comedi_cmd *cmd = &s->async->cmd;
+	unsigned int num_samples;
+	unsigned int bits_per_sample;
+
+	switch (s->type) {
+	case COMEDI_SUBD_DI:
+	case COMEDI_SUBD_DO:
+	case COMEDI_SUBD_DIO:
+		bits_per_sample = 8 * bytes_per_sample(s);
+		num_samples = (cmd->chanlist_len + bits_per_sample - 1) /
+				bits_per_sample;
+		break;
+	default:
+		num_samples = cmd->chanlist_len;
+		break;
+	}
+	return num_samples * bytes_per_sample(s);
+}
+EXPORT_SYMBOL_GPL(comedi_bytes_per_scan);
+
 static int insn_rw_emulate_bits(struct comedi_device *dev,
 				struct comedi_subdevice *s,
 				struct comedi_insn *insn, unsigned int *data)
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index c33c3e5..407ec70 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -22,28 +22,6 @@
 
 #include "comedi_fc.h"
 
-unsigned int cfc_bytes_per_scan(struct comedi_subdevice *s)
-{
-	struct comedi_cmd *cmd = &s->async->cmd;
-	unsigned int num_samples;
-	unsigned int bits_per_sample;
-
-	switch (s->type) {
-	case COMEDI_SUBD_DI:
-	case COMEDI_SUBD_DO:
-	case COMEDI_SUBD_DIO:
-		bits_per_sample = 8 * bytes_per_sample(s);
-		num_samples = (cmd->chanlist_len + bits_per_sample - 1) /
-				bits_per_sample;
-		break;
-	default:
-		num_samples = cmd->chanlist_len;
-		break;
-	}
-	return num_samples * bytes_per_sample(s);
-}
-EXPORT_SYMBOL_GPL(cfc_bytes_per_scan);
-
 void cfc_inc_scan_progress(struct comedi_subdevice *s, unsigned int num_bytes)
 {
 	struct comedi_async *async = s->async;
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index 541b937..90acb8f 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -23,7 +23,11 @@
 
 #include "../comedidev.h"
 
-unsigned int cfc_bytes_per_scan(struct comedi_subdevice *);
+static inline unsigned int cfc_bytes_per_scan(struct comedi_subdevice *s)
+{
+	return comedi_bytes_per_scan(s);
+}
+
 void cfc_inc_scan_progress(struct comedi_subdevice *, unsigned int num_bytes);
 
 /* Writes an array of data points to comedi's buffer */
-- 
2.1.0


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

* [PATCH 01/11] staging: comedi: add comedi_bytes_per_scan()
@ 2014-09-15 12:45   ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:45 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Greg Kroah-Hartman, Ian Abbott, linux-kernel

The "comedi_fc" module contains a few functions useful to Comedi
drivers.  Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`.  As part of this
migration, move `cfc_bytes_per_scan()` into the core comedi module and
rename it to `comedi_bytes_per_scan()`.  Change the external declaration
of `cfc_bytes_per_scan()` into an inline function that calls
`comedi_bytes_per_scan()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/comedidev.h         |  1 +
 drivers/staging/comedi/drivers.c           | 37 ++++++++++++++++++++++++++++++
 drivers/staging/comedi/drivers/comedi_fc.c | 22 ------------------
 drivers/staging/comedi/drivers/comedi_fc.h |  6 ++++-
 4 files changed, 43 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index bda5304..1c69509 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -447,6 +447,7 @@ int comedi_dio_insn_config(struct comedi_device *, struct comedi_subdevice *,
 			   unsigned int mask);
 unsigned int comedi_dio_update_state(struct comedi_subdevice *,
 				     unsigned int *data);
+unsigned int comedi_bytes_per_scan(struct comedi_subdevice *s);
 
 void *comedi_alloc_devpriv(struct comedi_device *, size_t);
 int comedi_alloc_subdevices(struct comedi_device *, int);
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index c4ed8fd..891c092 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -290,6 +290,43 @@ unsigned int comedi_dio_update_state(struct comedi_subdevice *s,
 }
 EXPORT_SYMBOL_GPL(comedi_dio_update_state);
 
+/**
+ * comedi_bytes_per_scan - get length of asynchronous command "scan" in bytes
+ * @s: comedi_subdevice struct
+ *
+ * Determines the overall scan length according to the subdevice type and the
+ * number of channels in the scan.
+ *
+ * For digital input, output or input/output subdevices, samples for multiple
+ * channels are assumed to be packed into one or more unsigned short or
+ * unsigned int values according to the subdevice's SDF_LSAMPL flag.  For other
+ * types of subdevice, samples are assumed to occupy a whole unsigned short or
+ * unsigned int according to the SDF_LSAMPL flag.
+ *
+ * Returns the overall scan length in bytes.
+ */
+unsigned int comedi_bytes_per_scan(struct comedi_subdevice *s)
+{
+	struct comedi_cmd *cmd = &s->async->cmd;
+	unsigned int num_samples;
+	unsigned int bits_per_sample;
+
+	switch (s->type) {
+	case COMEDI_SUBD_DI:
+	case COMEDI_SUBD_DO:
+	case COMEDI_SUBD_DIO:
+		bits_per_sample = 8 * bytes_per_sample(s);
+		num_samples = (cmd->chanlist_len + bits_per_sample - 1) /
+				bits_per_sample;
+		break;
+	default:
+		num_samples = cmd->chanlist_len;
+		break;
+	}
+	return num_samples * bytes_per_sample(s);
+}
+EXPORT_SYMBOL_GPL(comedi_bytes_per_scan);
+
 static int insn_rw_emulate_bits(struct comedi_device *dev,
 				struct comedi_subdevice *s,
 				struct comedi_insn *insn, unsigned int *data)
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index c33c3e5..407ec70 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -22,28 +22,6 @@
 
 #include "comedi_fc.h"
 
-unsigned int cfc_bytes_per_scan(struct comedi_subdevice *s)
-{
-	struct comedi_cmd *cmd = &s->async->cmd;
-	unsigned int num_samples;
-	unsigned int bits_per_sample;
-
-	switch (s->type) {
-	case COMEDI_SUBD_DI:
-	case COMEDI_SUBD_DO:
-	case COMEDI_SUBD_DIO:
-		bits_per_sample = 8 * bytes_per_sample(s);
-		num_samples = (cmd->chanlist_len + bits_per_sample - 1) /
-				bits_per_sample;
-		break;
-	default:
-		num_samples = cmd->chanlist_len;
-		break;
-	}
-	return num_samples * bytes_per_sample(s);
-}
-EXPORT_SYMBOL_GPL(cfc_bytes_per_scan);
-
 void cfc_inc_scan_progress(struct comedi_subdevice *s, unsigned int num_bytes)
 {
 	struct comedi_async *async = s->async;
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index 541b937..90acb8f 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -23,7 +23,11 @@
 
 #include "../comedidev.h"
 
-unsigned int cfc_bytes_per_scan(struct comedi_subdevice *);
+static inline unsigned int cfc_bytes_per_scan(struct comedi_subdevice *s)
+{
+	return comedi_bytes_per_scan(s);
+}
+
 void cfc_inc_scan_progress(struct comedi_subdevice *, unsigned int num_bytes);
 
 /* Writes an array of data points to comedi's buffer */
-- 
2.1.0

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

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

* [PATCH 02/11] staging: comedi: comedi_fc: use comedi_bytes_per_scan()
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 12:45   ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:45 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

Since `cfc_bytes_per_scan()` is just an inline function that calls
`comedi_bytes_per_scan()`, replace calls to the former to the latter in
the "comedi_fc" module.  This is part of the migration of functionality
from the "comedi_fc" module to the core "comedi" module.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/drivers/comedi_fc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index 407ec70..72fa718 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -25,7 +25,7 @@
 void cfc_inc_scan_progress(struct comedi_subdevice *s, unsigned int num_bytes)
 {
 	struct comedi_async *async = s->async;
-	unsigned int scan_length = cfc_bytes_per_scan(s);
+	unsigned int scan_length = comedi_bytes_per_scan(s);
 
 	async->scan_progress += num_bytes;
 	if (async->scan_progress >= scan_length) {
-- 
2.1.0


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

* [PATCH 02/11] staging: comedi: comedi_fc: use comedi_bytes_per_scan()
@ 2014-09-15 12:45   ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:45 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Greg Kroah-Hartman, Ian Abbott, linux-kernel

Since `cfc_bytes_per_scan()` is just an inline function that calls
`comedi_bytes_per_scan()`, replace calls to the former to the latter in
the "comedi_fc" module.  This is part of the migration of functionality
from the "comedi_fc" module to the core "comedi" module.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/drivers/comedi_fc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index 407ec70..72fa718 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -25,7 +25,7 @@
 void cfc_inc_scan_progress(struct comedi_subdevice *s, unsigned int num_bytes)
 {
 	struct comedi_async *async = s->async;
-	unsigned int scan_length = cfc_bytes_per_scan(s);
+	unsigned int scan_length = comedi_bytes_per_scan(s);
 
 	async->scan_progress += num_bytes;
 	if (async->scan_progress >= scan_length) {
-- 
2.1.0

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

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

* [PATCH 03/11] staging: comedi: add comedi_inc_scan_progress()
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 12:45   ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:45 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

The "comedi_fc" module contains a few functions useful to Comedi
drivers.  Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`.  As part of this
migration, move `cfc_inc_scan_progress()` into the core comedi module
and rename it to `comedi_inc_scan_progress()`.  Change the external
declaration of `cfc_inc_scan_progress()` into an inline function that
calls `comedi_inc_scan_progress()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/comedidev.h         |  2 ++
 drivers/staging/comedi/drivers.c           | 24 ++++++++++++++++++++++++
 drivers/staging/comedi/drivers/comedi_fc.c | 13 -------------
 drivers/staging/comedi/drivers/comedi_fc.h |  6 +++++-
 4 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index 1c69509..de69725 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -448,6 +448,8 @@ int comedi_dio_insn_config(struct comedi_device *, struct comedi_subdevice *,
 unsigned int comedi_dio_update_state(struct comedi_subdevice *,
 				     unsigned int *data);
 unsigned int comedi_bytes_per_scan(struct comedi_subdevice *s);
+void comedi_inc_scan_progress(struct comedi_subdevice *s,
+			      unsigned int num_bytes);
 
 void *comedi_alloc_devpriv(struct comedi_device *, size_t);
 int comedi_alloc_subdevices(struct comedi_device *, int);
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 891c092..691a2c4 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -327,6 +327,30 @@ unsigned int comedi_bytes_per_scan(struct comedi_subdevice *s)
 }
 EXPORT_SYMBOL_GPL(comedi_bytes_per_scan);
 
+/**
+ * comedi_inc_scan_progress - update scan progress in asynchronous command
+ * @s: comedi_subdevice struct
+ * @num_bytes: amount of data in bytes to increment scan progress
+ *
+ * Increments the scan progress by the number of bytes specified by num_bytes.
+ * If the scan progress reaches or exceeds the scan length in bytes, reduce
+ * it modulo the scan length in bytes and set the "end of scan" asynchronous
+ * event flag to be processed later.
+ */
+void comedi_inc_scan_progress(struct comedi_subdevice *s,
+			      unsigned int num_bytes)
+{
+	struct comedi_async *async = s->async;
+	unsigned int scan_length = comedi_bytes_per_scan(s);
+
+	async->scan_progress += num_bytes;
+	if (async->scan_progress >= scan_length) {
+		async->scan_progress %= scan_length;
+		async->events |= COMEDI_CB_EOS;
+	}
+}
+EXPORT_SYMBOL_GPL(comedi_inc_scan_progress);
+
 static int insn_rw_emulate_bits(struct comedi_device *dev,
 				struct comedi_subdevice *s,
 				struct comedi_insn *insn, unsigned int *data)
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index 72fa718..8a4abe8 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -22,19 +22,6 @@
 
 #include "comedi_fc.h"
 
-void cfc_inc_scan_progress(struct comedi_subdevice *s, unsigned int num_bytes)
-{
-	struct comedi_async *async = s->async;
-	unsigned int scan_length = comedi_bytes_per_scan(s);
-
-	async->scan_progress += num_bytes;
-	if (async->scan_progress >= scan_length) {
-		async->scan_progress %= scan_length;
-		async->events |= COMEDI_CB_EOS;
-	}
-}
-EXPORT_SYMBOL_GPL(cfc_inc_scan_progress);
-
 /* Writes an array of data points to comedi's buffer */
 unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
 				       void *data, unsigned int num_bytes)
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index 90acb8f..d0fe26c 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -28,7 +28,11 @@ static inline unsigned int cfc_bytes_per_scan(struct comedi_subdevice *s)
 	return comedi_bytes_per_scan(s);
 }
 
-void cfc_inc_scan_progress(struct comedi_subdevice *, unsigned int num_bytes);
+static inline void cfc_inc_scan_progress(struct comedi_subdevice *s,
+					 unsigned int num_bytes)
+{
+	comedi_inc_scan_progress(s, num_bytes);
+}
 
 /* Writes an array of data points to comedi's buffer */
 unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *,
-- 
2.1.0


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

* [PATCH 03/11] staging: comedi: add comedi_inc_scan_progress()
@ 2014-09-15 12:45   ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:45 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Greg Kroah-Hartman, Ian Abbott, linux-kernel

The "comedi_fc" module contains a few functions useful to Comedi
drivers.  Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`.  As part of this
migration, move `cfc_inc_scan_progress()` into the core comedi module
and rename it to `comedi_inc_scan_progress()`.  Change the external
declaration of `cfc_inc_scan_progress()` into an inline function that
calls `comedi_inc_scan_progress()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/comedidev.h         |  2 ++
 drivers/staging/comedi/drivers.c           | 24 ++++++++++++++++++++++++
 drivers/staging/comedi/drivers/comedi_fc.c | 13 -------------
 drivers/staging/comedi/drivers/comedi_fc.h |  6 +++++-
 4 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index 1c69509..de69725 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -448,6 +448,8 @@ int comedi_dio_insn_config(struct comedi_device *, struct comedi_subdevice *,
 unsigned int comedi_dio_update_state(struct comedi_subdevice *,
 				     unsigned int *data);
 unsigned int comedi_bytes_per_scan(struct comedi_subdevice *s);
+void comedi_inc_scan_progress(struct comedi_subdevice *s,
+			      unsigned int num_bytes);
 
 void *comedi_alloc_devpriv(struct comedi_device *, size_t);
 int comedi_alloc_subdevices(struct comedi_device *, int);
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 891c092..691a2c4 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -327,6 +327,30 @@ unsigned int comedi_bytes_per_scan(struct comedi_subdevice *s)
 }
 EXPORT_SYMBOL_GPL(comedi_bytes_per_scan);
 
+/**
+ * comedi_inc_scan_progress - update scan progress in asynchronous command
+ * @s: comedi_subdevice struct
+ * @num_bytes: amount of data in bytes to increment scan progress
+ *
+ * Increments the scan progress by the number of bytes specified by num_bytes.
+ * If the scan progress reaches or exceeds the scan length in bytes, reduce
+ * it modulo the scan length in bytes and set the "end of scan" asynchronous
+ * event flag to be processed later.
+ */
+void comedi_inc_scan_progress(struct comedi_subdevice *s,
+			      unsigned int num_bytes)
+{
+	struct comedi_async *async = s->async;
+	unsigned int scan_length = comedi_bytes_per_scan(s);
+
+	async->scan_progress += num_bytes;
+	if (async->scan_progress >= scan_length) {
+		async->scan_progress %= scan_length;
+		async->events |= COMEDI_CB_EOS;
+	}
+}
+EXPORT_SYMBOL_GPL(comedi_inc_scan_progress);
+
 static int insn_rw_emulate_bits(struct comedi_device *dev,
 				struct comedi_subdevice *s,
 				struct comedi_insn *insn, unsigned int *data)
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index 72fa718..8a4abe8 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -22,19 +22,6 @@
 
 #include "comedi_fc.h"
 
-void cfc_inc_scan_progress(struct comedi_subdevice *s, unsigned int num_bytes)
-{
-	struct comedi_async *async = s->async;
-	unsigned int scan_length = comedi_bytes_per_scan(s);
-
-	async->scan_progress += num_bytes;
-	if (async->scan_progress >= scan_length) {
-		async->scan_progress %= scan_length;
-		async->events |= COMEDI_CB_EOS;
-	}
-}
-EXPORT_SYMBOL_GPL(cfc_inc_scan_progress);
-
 /* Writes an array of data points to comedi's buffer */
 unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
 				       void *data, unsigned int num_bytes)
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index 90acb8f..d0fe26c 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -28,7 +28,11 @@ static inline unsigned int cfc_bytes_per_scan(struct comedi_subdevice *s)
 	return comedi_bytes_per_scan(s);
 }
 
-void cfc_inc_scan_progress(struct comedi_subdevice *, unsigned int num_bytes);
+static inline void cfc_inc_scan_progress(struct comedi_subdevice *s,
+					 unsigned int num_bytes)
+{
+	comedi_inc_scan_progress(s, num_bytes);
+}
 
 /* Writes an array of data points to comedi's buffer */
 unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *,
-- 
2.1.0

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

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

* [PATCH 04/11] staging: comedi: comedi_fc: use comedi_inc_scan_progress()
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 12:46   ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

Since `cfc_inc_scan_progress()` is just an inline function that calls
`comedi_inc_scan_progress()`, replace calls to the former to the latter
in the "comedi_fc" module.  This is part of the migration of
functionality from the "comedi_fc" module to the core "comedi" module.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/drivers/comedi_fc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index 8a4abe8..7401e78 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -41,7 +41,7 @@ unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
 
 	comedi_buf_memcpy_to(s, 0, data, num_bytes);
 	comedi_buf_write_free(s, num_bytes);
-	cfc_inc_scan_progress(s, num_bytes);
+	comedi_inc_scan_progress(s, num_bytes);
 	async->events |= COMEDI_CB_BLOCK;
 
 	return num_bytes;
@@ -57,7 +57,7 @@ unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *s,
 	num_bytes = comedi_buf_read_alloc(s, num_bytes);
 	comedi_buf_memcpy_from(s, 0, data, num_bytes);
 	comedi_buf_read_free(s, num_bytes);
-	cfc_inc_scan_progress(s, num_bytes);
+	comedi_inc_scan_progress(s, num_bytes);
 	s->async->events |= COMEDI_CB_BLOCK;
 
 	return num_bytes;
-- 
2.1.0


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

* [PATCH 04/11] staging: comedi: comedi_fc: use comedi_inc_scan_progress()
@ 2014-09-15 12:46   ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

Since `cfc_inc_scan_progress()` is just an inline function that calls
`comedi_inc_scan_progress()`, replace calls to the former to the latter
in the "comedi_fc" module.  This is part of the migration of
functionality from the "comedi_fc" module to the core "comedi" module.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/drivers/comedi_fc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index 8a4abe8..7401e78 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -41,7 +41,7 @@ unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
 
 	comedi_buf_memcpy_to(s, 0, data, num_bytes);
 	comedi_buf_write_free(s, num_bytes);
-	cfc_inc_scan_progress(s, num_bytes);
+	comedi_inc_scan_progress(s, num_bytes);
 	async->events |= COMEDI_CB_BLOCK;
 
 	return num_bytes;
@@ -57,7 +57,7 @@ unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *s,
 	num_bytes = comedi_buf_read_alloc(s, num_bytes);
 	comedi_buf_memcpy_from(s, 0, data, num_bytes);
 	comedi_buf_read_free(s, num_bytes);
-	cfc_inc_scan_progress(s, num_bytes);
+	comedi_inc_scan_progress(s, num_bytes);
 	s->async->events |= COMEDI_CB_BLOCK;
 
 	return num_bytes;
-- 
2.1.0

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

* [PATCH 05/11] staging: comedi: add comedi_handle_events()
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 12:46   ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

The "comedi_fc" module contains a few functions useful to Comedi
drivers.  Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`.  As part of this
migration, move `cfc_handle_events()` into the core comedi module and
rename it to `comedi_handle_events()`.  Change the external declaration
of `cfc_handle_events()` into an inline function that calls
`comedi_handle_events()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/comedidev.h         |  3 +++
 drivers/staging/comedi/drivers.c           | 33 ++++++++++++++++++++++++++++++
 drivers/staging/comedi/drivers/comedi_fc.c | 17 ---------------
 drivers/staging/comedi/drivers/comedi_fc.h |  7 +++++--
 4 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index de69725..e2ba025 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -442,6 +442,9 @@ int comedi_timeout(struct comedi_device *, struct comedi_subdevice *,
 			     struct comedi_insn *, unsigned long context),
 		   unsigned long context);
 
+unsigned int comedi_handle_events(struct comedi_device *dev,
+				  struct comedi_subdevice *s);
+
 int comedi_dio_insn_config(struct comedi_device *, struct comedi_subdevice *,
 			   struct comedi_insn *, unsigned int *data,
 			   unsigned int mask);
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 691a2c4..3c7d865 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -351,6 +351,39 @@ void comedi_inc_scan_progress(struct comedi_subdevice *s,
 }
 EXPORT_SYMBOL_GPL(comedi_inc_scan_progress);
 
+/**
+ * comedi_handle_events - handle events and possibly stop acquisition
+ * @dev: comedi_device struct
+ * @s: comedi_subdevice struct
+ *
+ * Handles outstanding asynchronous acquisition event flags associated
+ * with the subdevice.  Call the subdevice's "->cancel()" handler if the
+ * "end of acquisition", "error" or "overflow" event flags are set in order
+ * to stop the acquisition at the driver level.
+ *
+ * Calls comedi_event() to further process the event flags, which may mark
+ * the asynchronous command as no longer running, possibly terminated with
+ * an error, and may wake up tasks.
+ *
+ * Return a bit-mask of the handled events.
+ */
+unsigned int comedi_handle_events(struct comedi_device *dev,
+				  struct comedi_subdevice *s)
+{
+	unsigned int events = s->async->events;
+
+	if (events == 0)
+		return events;
+
+	if (events & (COMEDI_CB_EOA | COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW))
+		s->cancel(dev, s);
+
+	comedi_event(dev, s);
+
+	return events;
+}
+EXPORT_SYMBOL_GPL(comedi_handle_events);
+
 static int insn_rw_emulate_bits(struct comedi_device *dev,
 				struct comedi_subdevice *s,
 				struct comedi_insn *insn, unsigned int *data)
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index 7401e78..ed0e79f 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -64,23 +64,6 @@ unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *s,
 }
 EXPORT_SYMBOL_GPL(cfc_read_array_from_buffer);
 
-unsigned int cfc_handle_events(struct comedi_device *dev,
-			       struct comedi_subdevice *s)
-{
-	unsigned int events = s->async->events;
-
-	if (events == 0)
-		return events;
-
-	if (events & (COMEDI_CB_EOA | COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW))
-		s->cancel(dev, s);
-
-	comedi_event(dev, s);
-
-	return events;
-}
-EXPORT_SYMBOL_GPL(cfc_handle_events);
-
 static int __init comedi_fc_init_module(void)
 {
 	return 0;
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index d0fe26c..c570c6eb 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -53,8 +53,11 @@ static inline unsigned int cfc_write_long_to_buffer(struct comedi_subdevice *s,
 unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *,
 					void *data, unsigned int num_bytes);
 
-unsigned int cfc_handle_events(struct comedi_device *,
-			       struct comedi_subdevice *);
+static inline unsigned int cfc_handle_events(struct comedi_device *dev,
+					     struct comedi_subdevice *s)
+{
+	return comedi_handle_events(dev, s);
+}
 
 /**
  * cfc_check_trigger_src() - trivially validate a comedi_cmd trigger source
-- 
2.1.0


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

* [PATCH 05/11] staging: comedi: add comedi_handle_events()
@ 2014-09-15 12:46   ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Greg Kroah-Hartman, Ian Abbott, linux-kernel

The "comedi_fc" module contains a few functions useful to Comedi
drivers.  Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`.  As part of this
migration, move `cfc_handle_events()` into the core comedi module and
rename it to `comedi_handle_events()`.  Change the external declaration
of `cfc_handle_events()` into an inline function that calls
`comedi_handle_events()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/comedidev.h         |  3 +++
 drivers/staging/comedi/drivers.c           | 33 ++++++++++++++++++++++++++++++
 drivers/staging/comedi/drivers/comedi_fc.c | 17 ---------------
 drivers/staging/comedi/drivers/comedi_fc.h |  7 +++++--
 4 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index de69725..e2ba025 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -442,6 +442,9 @@ int comedi_timeout(struct comedi_device *, struct comedi_subdevice *,
 			     struct comedi_insn *, unsigned long context),
 		   unsigned long context);
 
+unsigned int comedi_handle_events(struct comedi_device *dev,
+				  struct comedi_subdevice *s);
+
 int comedi_dio_insn_config(struct comedi_device *, struct comedi_subdevice *,
 			   struct comedi_insn *, unsigned int *data,
 			   unsigned int mask);
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 691a2c4..3c7d865 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -351,6 +351,39 @@ void comedi_inc_scan_progress(struct comedi_subdevice *s,
 }
 EXPORT_SYMBOL_GPL(comedi_inc_scan_progress);
 
+/**
+ * comedi_handle_events - handle events and possibly stop acquisition
+ * @dev: comedi_device struct
+ * @s: comedi_subdevice struct
+ *
+ * Handles outstanding asynchronous acquisition event flags associated
+ * with the subdevice.  Call the subdevice's "->cancel()" handler if the
+ * "end of acquisition", "error" or "overflow" event flags are set in order
+ * to stop the acquisition at the driver level.
+ *
+ * Calls comedi_event() to further process the event flags, which may mark
+ * the asynchronous command as no longer running, possibly terminated with
+ * an error, and may wake up tasks.
+ *
+ * Return a bit-mask of the handled events.
+ */
+unsigned int comedi_handle_events(struct comedi_device *dev,
+				  struct comedi_subdevice *s)
+{
+	unsigned int events = s->async->events;
+
+	if (events == 0)
+		return events;
+
+	if (events & (COMEDI_CB_EOA | COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW))
+		s->cancel(dev, s);
+
+	comedi_event(dev, s);
+
+	return events;
+}
+EXPORT_SYMBOL_GPL(comedi_handle_events);
+
 static int insn_rw_emulate_bits(struct comedi_device *dev,
 				struct comedi_subdevice *s,
 				struct comedi_insn *insn, unsigned int *data)
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index 7401e78..ed0e79f 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -64,23 +64,6 @@ unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *s,
 }
 EXPORT_SYMBOL_GPL(cfc_read_array_from_buffer);
 
-unsigned int cfc_handle_events(struct comedi_device *dev,
-			       struct comedi_subdevice *s)
-{
-	unsigned int events = s->async->events;
-
-	if (events == 0)
-		return events;
-
-	if (events & (COMEDI_CB_EOA | COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW))
-		s->cancel(dev, s);
-
-	comedi_event(dev, s);
-
-	return events;
-}
-EXPORT_SYMBOL_GPL(cfc_handle_events);
-
 static int __init comedi_fc_init_module(void)
 {
 	return 0;
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index d0fe26c..c570c6eb 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -53,8 +53,11 @@ static inline unsigned int cfc_write_long_to_buffer(struct comedi_subdevice *s,
 unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *,
 					void *data, unsigned int num_bytes);
 
-unsigned int cfc_handle_events(struct comedi_device *,
-			       struct comedi_subdevice *);
+static inline unsigned int cfc_handle_events(struct comedi_device *dev,
+					     struct comedi_subdevice *s)
+{
+	return comedi_handle_events(dev, s);
+}
 
 /**
  * cfc_check_trigger_src() - trivially validate a comedi_cmd trigger source
-- 
2.1.0

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

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

* [PATCH 06/11] staging: comedi: comedi_fc: cfc_write_array_to_buffer() data is const
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 12:46   ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

The `data` pointer of `cfc_write_array_to_buffer()` ought to point to
`const` data.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/drivers/comedi_fc.c | 2 +-
 drivers/staging/comedi/drivers/comedi_fc.h | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index ed0e79f..6f87220 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -24,7 +24,7 @@
 
 /* Writes an array of data points to comedi's buffer */
 unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
-				       void *data, unsigned int num_bytes)
+				       const void *data, unsigned int num_bytes)
 {
 	struct comedi_async *async = s->async;
 	unsigned int retval;
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index c570c6eb..fa3de9e 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -35,8 +35,9 @@ static inline void cfc_inc_scan_progress(struct comedi_subdevice *s,
 }
 
 /* Writes an array of data points to comedi's buffer */
-unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *,
-				       void *data, unsigned int num_bytes);
+unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
+				       const void *data,
+				       unsigned int num_bytes);
 
 static inline unsigned int cfc_write_to_buffer(struct comedi_subdevice *s,
 					       unsigned short data)
-- 
2.1.0


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

* [PATCH 06/11] staging: comedi: comedi_fc: cfc_write_array_to_buffer() data is const
@ 2014-09-15 12:46   ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Greg Kroah-Hartman, Ian Abbott, linux-kernel

The `data` pointer of `cfc_write_array_to_buffer()` ought to point to
`const` data.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/drivers/comedi_fc.c | 2 +-
 drivers/staging/comedi/drivers/comedi_fc.h | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index ed0e79f..6f87220 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -24,7 +24,7 @@
 
 /* Writes an array of data points to comedi's buffer */
 unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
-				       void *data, unsigned int num_bytes)
+				       const void *data, unsigned int num_bytes)
 {
 	struct comedi_async *async = s->async;
 	unsigned int retval;
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index c570c6eb..fa3de9e 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -35,8 +35,9 @@ static inline void cfc_inc_scan_progress(struct comedi_subdevice *s,
 }
 
 /* Writes an array of data points to comedi's buffer */
-unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *,
-				       void *data, unsigned int num_bytes);
+unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
+				       const void *data,
+				       unsigned int num_bytes);
 
 static inline unsigned int cfc_write_to_buffer(struct comedi_subdevice *s,
 					       unsigned short data)
-- 
2.1.0

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

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

* [PATCH 07/11] staging: comedi: add comedi_write_array_to_buffer()
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 12:46   ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

The "comedi_fc" module contains a few functions useful to Comedi
drivers.  Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`.  As part of this
migration, move `cfc_write_array_to_buffer()` into the core comedi
module and rename it to `comedi_write_array_to_buffer()`.  Change the
external declaration of `cfc_write_array_to_buffer()` into an inline
function that calls `comedi_write_array_to_buffer()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/comedi_buf.c        | 27 +++++++++++++++++++++++++++
 drivers/staging/comedi/comedidev.h         |  3 +++
 drivers/staging/comedi/drivers/comedi_fc.c | 26 --------------------------
 drivers/staging/comedi/drivers/comedi_fc.h | 10 ++++++----
 4 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index df4a9c4..5aa8684 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -509,3 +509,30 @@ void comedi_buf_memcpy_from(struct comedi_subdevice *s, unsigned int offset,
 	}
 }
 EXPORT_SYMBOL_GPL(comedi_buf_memcpy_from);
+
+/* Writes an array of data points to comedi's buffer */
+unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
+					  const void *data,
+					  unsigned int num_bytes)
+{
+	struct comedi_async *async = s->async;
+	unsigned int retval;
+
+	if (num_bytes == 0)
+		return 0;
+
+	retval = comedi_buf_write_alloc(s, num_bytes);
+	if (retval != num_bytes) {
+		dev_warn(s->device->class_dev, "buffer overrun\n");
+		async->events |= COMEDI_CB_OVERFLOW;
+		return 0;
+	}
+
+	comedi_buf_memcpy_to(s, 0, data, num_bytes);
+	comedi_buf_write_free(s, num_bytes);
+	comedi_inc_scan_progress(s, num_bytes);
+	async->events |= COMEDI_CB_BLOCK;
+
+	return num_bytes;
+}
+EXPORT_SYMBOL_GPL(comedi_write_array_to_buffer);
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index e2ba025..cbcbf9e 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -431,6 +431,9 @@ void comedi_buf_memcpy_to(struct comedi_subdevice *s, unsigned int offset,
 			  const void *source, unsigned int num_bytes);
 void comedi_buf_memcpy_from(struct comedi_subdevice *s, unsigned int offset,
 			    void *destination, unsigned int num_bytes);
+unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
+					  const void *data,
+					  unsigned int num_bytes);
 
 /* drivers.c - general comedi driver functions */
 
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index 6f87220..d4244eb 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -22,32 +22,6 @@
 
 #include "comedi_fc.h"
 
-/* Writes an array of data points to comedi's buffer */
-unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
-				       const void *data, unsigned int num_bytes)
-{
-	struct comedi_async *async = s->async;
-	unsigned int retval;
-
-	if (num_bytes == 0)
-		return 0;
-
-	retval = comedi_buf_write_alloc(s, num_bytes);
-	if (retval != num_bytes) {
-		dev_warn(s->device->class_dev, "buffer overrun\n");
-		async->events |= COMEDI_CB_OVERFLOW;
-		return 0;
-	}
-
-	comedi_buf_memcpy_to(s, 0, data, num_bytes);
-	comedi_buf_write_free(s, num_bytes);
-	comedi_inc_scan_progress(s, num_bytes);
-	async->events |= COMEDI_CB_BLOCK;
-
-	return num_bytes;
-}
-EXPORT_SYMBOL_GPL(cfc_write_array_to_buffer);
-
 unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *s,
 					void *data, unsigned int num_bytes)
 {
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index fa3de9e..51b3157 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -34,10 +34,12 @@ static inline void cfc_inc_scan_progress(struct comedi_subdevice *s,
 	comedi_inc_scan_progress(s, num_bytes);
 }
 
-/* Writes an array of data points to comedi's buffer */
-unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
-				       const void *data,
-				       unsigned int num_bytes);
+static inline unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
+						     const void *data,
+						     unsigned int num_bytes)
+{
+	return comedi_write_array_to_buffer(s, data, num_bytes);
+}
 
 static inline unsigned int cfc_write_to_buffer(struct comedi_subdevice *s,
 					       unsigned short data)
-- 
2.1.0


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

* [PATCH 07/11] staging: comedi: add comedi_write_array_to_buffer()
@ 2014-09-15 12:46   ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Greg Kroah-Hartman, Ian Abbott, linux-kernel

The "comedi_fc" module contains a few functions useful to Comedi
drivers.  Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`.  As part of this
migration, move `cfc_write_array_to_buffer()` into the core comedi
module and rename it to `comedi_write_array_to_buffer()`.  Change the
external declaration of `cfc_write_array_to_buffer()` into an inline
function that calls `comedi_write_array_to_buffer()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/comedi_buf.c        | 27 +++++++++++++++++++++++++++
 drivers/staging/comedi/comedidev.h         |  3 +++
 drivers/staging/comedi/drivers/comedi_fc.c | 26 --------------------------
 drivers/staging/comedi/drivers/comedi_fc.h | 10 ++++++----
 4 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index df4a9c4..5aa8684 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -509,3 +509,30 @@ void comedi_buf_memcpy_from(struct comedi_subdevice *s, unsigned int offset,
 	}
 }
 EXPORT_SYMBOL_GPL(comedi_buf_memcpy_from);
+
+/* Writes an array of data points to comedi's buffer */
+unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
+					  const void *data,
+					  unsigned int num_bytes)
+{
+	struct comedi_async *async = s->async;
+	unsigned int retval;
+
+	if (num_bytes == 0)
+		return 0;
+
+	retval = comedi_buf_write_alloc(s, num_bytes);
+	if (retval != num_bytes) {
+		dev_warn(s->device->class_dev, "buffer overrun\n");
+		async->events |= COMEDI_CB_OVERFLOW;
+		return 0;
+	}
+
+	comedi_buf_memcpy_to(s, 0, data, num_bytes);
+	comedi_buf_write_free(s, num_bytes);
+	comedi_inc_scan_progress(s, num_bytes);
+	async->events |= COMEDI_CB_BLOCK;
+
+	return num_bytes;
+}
+EXPORT_SYMBOL_GPL(comedi_write_array_to_buffer);
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index e2ba025..cbcbf9e 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -431,6 +431,9 @@ void comedi_buf_memcpy_to(struct comedi_subdevice *s, unsigned int offset,
 			  const void *source, unsigned int num_bytes);
 void comedi_buf_memcpy_from(struct comedi_subdevice *s, unsigned int offset,
 			    void *destination, unsigned int num_bytes);
+unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
+					  const void *data,
+					  unsigned int num_bytes);
 
 /* drivers.c - general comedi driver functions */
 
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index 6f87220..d4244eb 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -22,32 +22,6 @@
 
 #include "comedi_fc.h"
 
-/* Writes an array of data points to comedi's buffer */
-unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
-				       const void *data, unsigned int num_bytes)
-{
-	struct comedi_async *async = s->async;
-	unsigned int retval;
-
-	if (num_bytes == 0)
-		return 0;
-
-	retval = comedi_buf_write_alloc(s, num_bytes);
-	if (retval != num_bytes) {
-		dev_warn(s->device->class_dev, "buffer overrun\n");
-		async->events |= COMEDI_CB_OVERFLOW;
-		return 0;
-	}
-
-	comedi_buf_memcpy_to(s, 0, data, num_bytes);
-	comedi_buf_write_free(s, num_bytes);
-	comedi_inc_scan_progress(s, num_bytes);
-	async->events |= COMEDI_CB_BLOCK;
-
-	return num_bytes;
-}
-EXPORT_SYMBOL_GPL(cfc_write_array_to_buffer);
-
 unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *s,
 					void *data, unsigned int num_bytes)
 {
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index fa3de9e..51b3157 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -34,10 +34,12 @@ static inline void cfc_inc_scan_progress(struct comedi_subdevice *s,
 	comedi_inc_scan_progress(s, num_bytes);
 }
 
-/* Writes an array of data points to comedi's buffer */
-unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
-				       const void *data,
-				       unsigned int num_bytes);
+static inline unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
+						     const void *data,
+						     unsigned int num_bytes)
+{
+	return comedi_write_array_to_buffer(s, data, num_bytes);
+}
 
 static inline unsigned int cfc_write_to_buffer(struct comedi_subdevice *s,
 					       unsigned short data)
-- 
2.1.0

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

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

* [PATCH 08/11] staging: comedi: comedi_fc.h: use comedi_write_array_to_buffer()
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 12:46   ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

Since `cfc_write_array_to_buffer()` is just an inline function that
calls `comedi_write_array_to_buffer()`, replace calls to the former to
the latter in the "comedi_fc.h" header.  This is part of the migration
of functionality from the "comedi_fc" module to the core "comedi"
module.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/comedi_buf.c        | 13 ++++++++++++-
 drivers/staging/comedi/drivers/comedi_fc.h |  4 ++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index 5aa8684..52a75d2 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -510,7 +510,18 @@ void comedi_buf_memcpy_from(struct comedi_subdevice *s, unsigned int offset,
 }
 EXPORT_SYMBOL_GPL(comedi_buf_memcpy_from);
 
-/* Writes an array of data points to comedi's buffer */
+/**
+ * comedi_write_array_to_buffer - write data to comedi buffer
+ * @s: comedi_subdevice struct
+ * @data: destination
+ * @num_bytes: number of bytes to write
+ *
+ * Writes up to num_bytes bytes of data to the comedi buffer associated with
+ * the subdevice, marks it as written and updates the acquisition scan
+ * progress.
+ *
+ * Returns the amount of data written in bytes.
+ */
 unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
 					  const void *data,
 					  unsigned int num_bytes)
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index 51b3157..75bbc31 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -44,13 +44,13 @@ static inline unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
 static inline unsigned int cfc_write_to_buffer(struct comedi_subdevice *s,
 					       unsigned short data)
 {
-	return cfc_write_array_to_buffer(s, &data, sizeof(data));
+	return comedi_write_array_to_buffer(s, &data, sizeof(data));
 };
 
 static inline unsigned int cfc_write_long_to_buffer(struct comedi_subdevice *s,
 						    unsigned int data)
 {
-	return cfc_write_array_to_buffer(s, &data, sizeof(data));
+	return comedi_write_array_to_buffer(s, &data, sizeof(data));
 };
 
 unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *,
-- 
2.1.0


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

* [PATCH 08/11] staging: comedi: comedi_fc.h: use comedi_write_array_to_buffer()
@ 2014-09-15 12:46   ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Greg Kroah-Hartman, Ian Abbott, linux-kernel

Since `cfc_write_array_to_buffer()` is just an inline function that
calls `comedi_write_array_to_buffer()`, replace calls to the former to
the latter in the "comedi_fc.h" header.  This is part of the migration
of functionality from the "comedi_fc" module to the core "comedi"
module.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/comedi_buf.c        | 13 ++++++++++++-
 drivers/staging/comedi/drivers/comedi_fc.h |  4 ++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index 5aa8684..52a75d2 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -510,7 +510,18 @@ void comedi_buf_memcpy_from(struct comedi_subdevice *s, unsigned int offset,
 }
 EXPORT_SYMBOL_GPL(comedi_buf_memcpy_from);
 
-/* Writes an array of data points to comedi's buffer */
+/**
+ * comedi_write_array_to_buffer - write data to comedi buffer
+ * @s: comedi_subdevice struct
+ * @data: destination
+ * @num_bytes: number of bytes to write
+ *
+ * Writes up to num_bytes bytes of data to the comedi buffer associated with
+ * the subdevice, marks it as written and updates the acquisition scan
+ * progress.
+ *
+ * Returns the amount of data written in bytes.
+ */
 unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
 					  const void *data,
 					  unsigned int num_bytes)
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index 51b3157..75bbc31 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -44,13 +44,13 @@ static inline unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *s,
 static inline unsigned int cfc_write_to_buffer(struct comedi_subdevice *s,
 					       unsigned short data)
 {
-	return cfc_write_array_to_buffer(s, &data, sizeof(data));
+	return comedi_write_array_to_buffer(s, &data, sizeof(data));
 };
 
 static inline unsigned int cfc_write_long_to_buffer(struct comedi_subdevice *s,
 						    unsigned int data)
 {
-	return cfc_write_array_to_buffer(s, &data, sizeof(data));
+	return comedi_write_array_to_buffer(s, &data, sizeof(data));
 };
 
 unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *,
-- 
2.1.0

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

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

* [PATCH 09/11] staging: comedi: add comedi_read_array_from_buffer()
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 12:46   ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

The "comedi_fc" module contains a few functions useful to Comedi
drivers.  Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`.  As part of this
migration, move `cfc_read_array_from_buffer()` into the core comedi
module and rename it to `comedi_read_array_from_buffer()`.  Change the
external declaration of `cfc_read_array_from_buffer()` into an inline
function that calls `comedi_read_array_from_buffer()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/comedi_buf.c        | 27 +++++++++++++++++++++++++++
 drivers/staging/comedi/comedidev.h         |  2 ++
 drivers/staging/comedi/drivers/comedi_fc.c | 16 ----------------
 drivers/staging/comedi/drivers/comedi_fc.h |  8 ++++++--
 4 files changed, 35 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index 52a75d2..c3f5751 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -547,3 +547,30 @@ unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
 	return num_bytes;
 }
 EXPORT_SYMBOL_GPL(comedi_write_array_to_buffer);
+
+/**
+ * comedi_read_array_from_buffer - read data from comedi buffer
+ * @s: comedi_subdevice struct
+ * @data: destination
+ * @num_bytes: number of bytes to read
+ *
+ * Reads up to num_bytes bytes of data from the comedi buffer associated with
+ * the subdevice, marks it as read and updates the acquisition scan progress.
+ *
+ * Returns the amount of data read in bytes.
+ */
+unsigned int comedi_read_array_from_buffer(struct comedi_subdevice *s,
+					   void *data, unsigned int num_bytes)
+{
+	if (num_bytes == 0)
+		return 0;
+
+	num_bytes = comedi_buf_read_alloc(s, num_bytes);
+	comedi_buf_memcpy_from(s, 0, data, num_bytes);
+	comedi_buf_read_free(s, num_bytes);
+	comedi_inc_scan_progress(s, num_bytes);
+	s->async->events |= COMEDI_CB_BLOCK;
+
+	return num_bytes;
+}
+EXPORT_SYMBOL_GPL(comedi_read_array_from_buffer);
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index cbcbf9e..feec9f8 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -434,6 +434,8 @@ void comedi_buf_memcpy_from(struct comedi_subdevice *s, unsigned int offset,
 unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
 					  const void *data,
 					  unsigned int num_bytes);
+unsigned int comedi_read_array_from_buffer(struct comedi_subdevice *s,
+					   void *data, unsigned int num_bytes);
 
 /* drivers.c - general comedi driver functions */
 
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index d4244eb..6f99a1e 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -22,22 +22,6 @@
 
 #include "comedi_fc.h"
 
-unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *s,
-					void *data, unsigned int num_bytes)
-{
-	if (num_bytes == 0)
-		return 0;
-
-	num_bytes = comedi_buf_read_alloc(s, num_bytes);
-	comedi_buf_memcpy_from(s, 0, data, num_bytes);
-	comedi_buf_read_free(s, num_bytes);
-	comedi_inc_scan_progress(s, num_bytes);
-	s->async->events |= COMEDI_CB_BLOCK;
-
-	return num_bytes;
-}
-EXPORT_SYMBOL_GPL(cfc_read_array_from_buffer);
-
 static int __init comedi_fc_init_module(void)
 {
 	return 0;
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index 75bbc31..ce28359 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -53,8 +53,12 @@ static inline unsigned int cfc_write_long_to_buffer(struct comedi_subdevice *s,
 	return comedi_write_array_to_buffer(s, &data, sizeof(data));
 };
 
-unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *,
-					void *data, unsigned int num_bytes);
+static inline unsigned int
+cfc_read_array_from_buffer(struct comedi_subdevice *s, void *data,
+			   unsigned int num_bytes)
+{
+	return comedi_read_array_from_buffer(s, data, num_bytes);
+}
 
 static inline unsigned int cfc_handle_events(struct comedi_device *dev,
 					     struct comedi_subdevice *s)
-- 
2.1.0


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

* [PATCH 09/11] staging: comedi: add comedi_read_array_from_buffer()
@ 2014-09-15 12:46   ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Greg Kroah-Hartman, Ian Abbott, linux-kernel

The "comedi_fc" module contains a few functions useful to Comedi
drivers.  Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`.  As part of this
migration, move `cfc_read_array_from_buffer()` into the core comedi
module and rename it to `comedi_read_array_from_buffer()`.  Change the
external declaration of `cfc_read_array_from_buffer()` into an inline
function that calls `comedi_read_array_from_buffer()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/comedi_buf.c        | 27 +++++++++++++++++++++++++++
 drivers/staging/comedi/comedidev.h         |  2 ++
 drivers/staging/comedi/drivers/comedi_fc.c | 16 ----------------
 drivers/staging/comedi/drivers/comedi_fc.h |  8 ++++++--
 4 files changed, 35 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index 52a75d2..c3f5751 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -547,3 +547,30 @@ unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
 	return num_bytes;
 }
 EXPORT_SYMBOL_GPL(comedi_write_array_to_buffer);
+
+/**
+ * comedi_read_array_from_buffer - read data from comedi buffer
+ * @s: comedi_subdevice struct
+ * @data: destination
+ * @num_bytes: number of bytes to read
+ *
+ * Reads up to num_bytes bytes of data from the comedi buffer associated with
+ * the subdevice, marks it as read and updates the acquisition scan progress.
+ *
+ * Returns the amount of data read in bytes.
+ */
+unsigned int comedi_read_array_from_buffer(struct comedi_subdevice *s,
+					   void *data, unsigned int num_bytes)
+{
+	if (num_bytes == 0)
+		return 0;
+
+	num_bytes = comedi_buf_read_alloc(s, num_bytes);
+	comedi_buf_memcpy_from(s, 0, data, num_bytes);
+	comedi_buf_read_free(s, num_bytes);
+	comedi_inc_scan_progress(s, num_bytes);
+	s->async->events |= COMEDI_CB_BLOCK;
+
+	return num_bytes;
+}
+EXPORT_SYMBOL_GPL(comedi_read_array_from_buffer);
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index cbcbf9e..feec9f8 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -434,6 +434,8 @@ void comedi_buf_memcpy_from(struct comedi_subdevice *s, unsigned int offset,
 unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
 					  const void *data,
 					  unsigned int num_bytes);
+unsigned int comedi_read_array_from_buffer(struct comedi_subdevice *s,
+					   void *data, unsigned int num_bytes);
 
 /* drivers.c - general comedi driver functions */
 
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
index d4244eb..6f99a1e 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ b/drivers/staging/comedi/drivers/comedi_fc.c
@@ -22,22 +22,6 @@
 
 #include "comedi_fc.h"
 
-unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *s,
-					void *data, unsigned int num_bytes)
-{
-	if (num_bytes == 0)
-		return 0;
-
-	num_bytes = comedi_buf_read_alloc(s, num_bytes);
-	comedi_buf_memcpy_from(s, 0, data, num_bytes);
-	comedi_buf_read_free(s, num_bytes);
-	comedi_inc_scan_progress(s, num_bytes);
-	s->async->events |= COMEDI_CB_BLOCK;
-
-	return num_bytes;
-}
-EXPORT_SYMBOL_GPL(cfc_read_array_from_buffer);
-
 static int __init comedi_fc_init_module(void)
 {
 	return 0;
diff --git a/drivers/staging/comedi/drivers/comedi_fc.h b/drivers/staging/comedi/drivers/comedi_fc.h
index 75bbc31..ce28359 100644
--- a/drivers/staging/comedi/drivers/comedi_fc.h
+++ b/drivers/staging/comedi/drivers/comedi_fc.h
@@ -53,8 +53,12 @@ static inline unsigned int cfc_write_long_to_buffer(struct comedi_subdevice *s,
 	return comedi_write_array_to_buffer(s, &data, sizeof(data));
 };
 
-unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *,
-					void *data, unsigned int num_bytes);
+static inline unsigned int
+cfc_read_array_from_buffer(struct comedi_subdevice *s, void *data,
+			   unsigned int num_bytes)
+{
+	return comedi_read_array_from_buffer(s, data, num_bytes);
+}
 
 static inline unsigned int cfc_handle_events(struct comedi_device *dev,
 					     struct comedi_subdevice *s)
-- 
2.1.0

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

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

* [PATCH 10/11] staging: comedi: migrate copyrights from "comedi_fc.c"
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 12:46   ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

The "comedi_fc" module was originally written and copyrighted by Frank
Mori Hess, but the functionality has been migrated into the core
"comedi" module.  Move the copyright notices over to the affected .c
files in the core comedi module.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/comedi_buf.c | 1 +
 drivers/staging/comedi/drivers.c    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index c3f5751..c60a45ad 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -3,6 +3,7 @@
  *
  * COMEDI - Linux Control and Measurement Device Interface
  * Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
+ * Copyright (C) 2002 Frank Mori Hess <fmhess@users.sourceforge.net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 3c7d865..3e5bccb 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -4,6 +4,7 @@
 
     COMEDI - Linux Control and Measurement Device Interface
     Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
+    Copyright (C) 2002 Frank Mori Hess <fmhess@users.sourceforge.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
-- 
2.1.0


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

* [PATCH 10/11] staging: comedi: migrate copyrights from "comedi_fc.c"
@ 2014-09-15 12:46   ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Greg Kroah-Hartman, Ian Abbott, linux-kernel

The "comedi_fc" module was originally written and copyrighted by Frank
Mori Hess, but the functionality has been migrated into the core
"comedi" module.  Move the copyright notices over to the affected .c
files in the core comedi module.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/comedi_buf.c | 1 +
 drivers/staging/comedi/drivers.c    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index c3f5751..c60a45ad 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -3,6 +3,7 @@
  *
  * COMEDI - Linux Control and Measurement Device Interface
  * Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
+ * Copyright (C) 2002 Frank Mori Hess <fmhess@users.sourceforge.net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 3c7d865..3e5bccb 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -4,6 +4,7 @@
 
     COMEDI - Linux Control and Measurement Device Interface
     Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
+    Copyright (C) 2002 Frank Mori Hess <fmhess@users.sourceforge.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
-- 
2.1.0

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

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

* [PATCH 11/11] staging: comedi: remove comedi_fc module
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 12:46   ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel
  Cc: Greg Kroah-Hartman, Ian Abbott, H Hartley Sweeten, linux-kernel

All the exported functions in the "comedi_fc" module have been migrated
to the core "comedi" module and renamed, so it is now just a dummy
module.  Remove it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/Kconfig             | 31 ------------------------
 drivers/staging/comedi/drivers/Makefile    |  1 -
 drivers/staging/comedi/drivers/comedi_fc.c | 38 ------------------------------
 3 files changed, 70 deletions(-)
 delete mode 100644 drivers/staging/comedi/drivers/comedi_fc.c

diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
index fd5f939..ea4948f 100644
--- a/drivers/staging/comedi/Kconfig
+++ b/drivers/staging/comedi/Kconfig
@@ -56,7 +56,6 @@ config COMEDI_BOND
 
 config COMEDI_TEST
 	tristate "Fake waveform generator support"
-	select COMEDI_FC
 	---help---
 	  Enable support for the fake waveform generator.
 	  This driver is mainly for testing purposes, but can also be used to
@@ -170,7 +169,6 @@ config COMEDI_PCL730
 config COMEDI_PCL812
 	tristate "Advantech PCL-812/813 and ADlink ACL-8112/8113/8113/8216"
 	depends on VIRT_TO_BUS && ISA_DMA_API
-	select COMEDI_FC
 	---help---
 	  Enable support for Advantech PCL-812/PG, PCL-813/B, ADLink
 	  ACL-8112DG/HG/PG, ACL-8113, ACL-8216, ICP DAS A-821PGH/PGL/PGL-NDA,
@@ -182,7 +180,6 @@ config COMEDI_PCL812
 config COMEDI_PCL816
 	tristate "Advantech PCL-814 and PCL-816 ISA card support"
 	depends on VIRT_TO_BUS && ISA_DMA_API
-	select COMEDI_FC
 	---help---
 	  Enable support for Advantech PCL-814 and PCL-816 ISA cards
 
@@ -192,7 +189,6 @@ config COMEDI_PCL816
 config COMEDI_PCL818
 	tristate "Advantech PCL-718 and PCL-818 ISA card support"
 	depends on VIRT_TO_BUS && ISA_DMA_API
-	select COMEDI_FC
 	---help---
 	  Enable support for Advantech PCL-818 ISA cards
 	  PCL-818L, PCL-818H, PCL-818HD, PCL-818HG, PCL-818 and PCL-718
@@ -264,7 +260,6 @@ config COMEDI_DAC02
 config COMEDI_DAS16M1
 	tristate "MeasurementComputing CIO-DAS16/M1DAS-16 ISA card support"
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for Measurement Computing CIO-DAS16/M1 ISA cards.
 
@@ -288,7 +283,6 @@ config COMEDI_DAS16
 	tristate "DAS-16 compatible ISA and PC/104 card support"
 	depends on ISA_DMA_API
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for Keithley Metrabyte/ComputerBoards DAS16
 	  and compatible ISA and PC/104 cards:
@@ -304,7 +298,6 @@ config COMEDI_DAS16
 
 config COMEDI_DAS800
 	tristate "DAS800 and compatible ISA card support"
-	select COMEDI_FC
 	---help---
 	  Enable support for Keithley Metrabyte DAS800 and compatible ISA cards
 	  Keithley Metrabyte DAS-800, DAS-801, DAS-802
@@ -317,7 +310,6 @@ config COMEDI_DAS800
 config COMEDI_DAS1800
 	tristate "DAS1800 and compatible ISA card support"
 	depends on VIRT_TO_BUS && ISA_DMA_API
-	select COMEDI_FC
 	---help---
 	  Enable support for DAS1800 and compatible ISA cards
 	  Keithley Metrabyte DAS-1701ST, DAS-1701ST-DA, DAS-1701/AO,
@@ -380,7 +372,6 @@ config COMEDI_DT2817
 
 config COMEDI_DT282X
 	tristate "Data Translation DT2821 series and DT-EZ ISA card support"
-	select COMEDI_FC
 	depends on VIRT_TO_BUS && ISA_DMA_API
 	---help---
 	  Enable support for Data Translation DT2821 series including DT-EZ
@@ -469,7 +460,6 @@ config COMEDI_ADQ12B
 
 config COMEDI_NI_AT_A2150
 	tristate "NI AT-A2150 ISA card support"
-	select COMEDI_FC
 	depends on VIRT_TO_BUS && ISA_DMA_API
 	---help---
 	  Enable support for National Instruments AT-A2150 cards
@@ -489,7 +479,6 @@ config COMEDI_NI_ATMIO
 	tristate "NI AT-MIO E series ISA-PNP card support"
 	select COMEDI_8255
 	select COMEDI_NI_TIO
-	select COMEDI_FC
 	---help---
 	  Enable support for National Instruments AT-MIO E series cards
 	  National Instruments AT-MIO-16E-1 (ni_atmio),
@@ -678,7 +667,6 @@ config COMEDI_ADDI_APCI_2200
 config COMEDI_ADDI_APCI_3120
 	tristate "ADDI-DATA APCI_3120/3001 support"
 	depends on VIRT_TO_BUS
-	select COMEDI_FC
 	---help---
 	  Enable support for ADDI-DATA APCI_3120/3001 cards
 
@@ -730,7 +718,6 @@ config COMEDI_ADL_PCI8164
 
 config COMEDI_ADL_PCI9111
 	tristate "ADLink PCI-9111HR support"
-	select COMEDI_FC
 	---help---
 	  Enable support for ADlink PCI9111 cards
 
@@ -739,7 +726,6 @@ config COMEDI_ADL_PCI9111
 
 config COMEDI_ADL_PCI9118
 	tristate "ADLink PCI-9118DG, PCI-9118HG, PCI-9118HR support"
-	select COMEDI_FC
 	depends on VIRT_TO_BUS
 	---help---
 	  Enable support for ADlink PCI-9118DG, PCI-9118HG, PCI-9118HR cards
@@ -749,7 +735,6 @@ config COMEDI_ADL_PCI9118
 
 config COMEDI_ADV_PCI1710
 	tristate "Advantech PCI-171x, PCI-1720 and PCI-1731 support"
-	select COMEDI_FC
 	---help---
 	  Enable support for Advantech PCI-1710, PCI-1710HG, PCI-1711,
 	  PCI-1713, PCI-1720 and PCI-1731
@@ -817,7 +802,6 @@ config COMEDI_AMPLC_PC263_PCI
 
 config COMEDI_AMPLC_PCI224
 	tristate "Amplicon PCI224 and PCI234 support"
-	select COMEDI_FC
 	---help---
 	  Enable support for Amplicon PCI224 and PCI234 AO boards
 
@@ -853,7 +837,6 @@ config COMEDI_DAS08_PCI
 
 config COMEDI_DT3000
 	tristate "Data Translation DT3000 series support"
-	select COMEDI_FC
 	---help---
 	  Enable support for Data Translation DT3000 series
 	  DT3001, DT3001-PGL, DT3002, DT3003, DT3003-PGL, DT3004, DT3005 and
@@ -873,7 +856,6 @@ config COMEDI_DYNA_PCI10XX
 
 config COMEDI_GSC_HPDI
 	tristate "General Standards PCI-HPDI32 / PMC-HPDI32 support"
-	select COMEDI_FC
 	---help---
 	  Enable support for General Standards Corporation high speed parallel
 	  digital interface rs485 boards PCI-HPDI32 and PMC-HPDI32.
@@ -924,7 +906,6 @@ config COMEDI_KE_COUNTER
 config COMEDI_CB_PCIDAS64
 	tristate "MeasurementComputing PCI-DAS 64xx, 60xx, and 4020 support"
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for ComputerBoards/MeasurementComputing PCI-DAS 64xx,
 	  60xx, and 4020 series with the PLX 9080 PCI controller
@@ -935,7 +916,6 @@ config COMEDI_CB_PCIDAS64
 config COMEDI_CB_PCIDAS
 	tristate "MeasurementComputing PCI-DAS support"
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for ComputerBoards/MeasurementComputing PCI-DAS with
 	  AMCC S5933 PCIcontroller: PCI-DAS1602/16, PCI-DAS1602/16jr,
@@ -1058,7 +1038,6 @@ config COMEDI_NI_PCIMIO
 	depends on HAS_DMA
 	select COMEDI_NI_TIOCMD
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for National Instruments PCI-MIO-E series and M series
 	  (all boards): PCI-MIO-16XE-10, PXI-6030E, PCI-MIO-16E-1,
@@ -1084,7 +1063,6 @@ config COMEDI_RTD520
 
 config COMEDI_S626
 	tristate "Sensoray 626 support"
-	select COMEDI_FC
 	---help---
 	  Enable support for Sensoray 626
 
@@ -1093,7 +1071,6 @@ config COMEDI_S626
 
 config COMEDI_MITE
 	depends on HAS_DMA
-	select COMEDI_FC
 	tristate
 
 config COMEDI_NI_TIOCMD
@@ -1161,7 +1138,6 @@ config COMEDI_NI_MIO_CS
 	tristate "NI DAQCard E series PCMCIA support"
 	select COMEDI_NI_TIO
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for the National Instruments PCMCIA DAQCard E series
 	  DAQCard-ai-16xe-50, DAQCard-ai-16e-4, DAQCard-6062E, DAQCard-6024E
@@ -1172,7 +1148,6 @@ config COMEDI_NI_MIO_CS
 
 config COMEDI_QUATECH_DAQP_CS
 	tristate "Quatech DAQP PCMCIA data capture card support"
-	select COMEDI_FC
 	---help---
 	  Enable support for the Quatech DAQP PCMCIA data capture cards
 	  DAQP-208 and DAQP-308
@@ -1219,7 +1194,6 @@ config COMEDI_USBDUX
 
 config COMEDI_USBDUXFAST
 	tristate "ITL USB-DUXfast support"
-	select COMEDI_FC
 	---help---
 	  Enable support for the Incite Technology Ltd USB-DUXfast Board
 
@@ -1228,7 +1202,6 @@ config COMEDI_USBDUXFAST
 
 config COMEDI_USBDUXSIGMA
 	tristate "ITL USB-DUXsigma support"
-	select COMEDI_FC
 	---help---
 	  Enable support for the Incite Technology Ltd USB-DUXsigma Board
 
@@ -1275,9 +1248,6 @@ config COMEDI_KCOMEDILIB
 	  To compile kcomedilib as a module, choose M here: the module will be
 	  called kcomedilib.
 
-config COMEDI_FC
-	tristate
-
 config COMEDI_AMPLC_DIO200
 	tristate
 
@@ -1292,7 +1262,6 @@ config COMEDI_DAS08
 config COMEDI_NI_LABPC
 	tristate
 	select COMEDI_8255
-	select COMEDI_FC
 
 config COMEDI_NI_LABPC_ISADMA
 	tristate
diff --git a/drivers/staging/comedi/drivers/Makefile b/drivers/staging/comedi/drivers/Makefile
index ba6f6e0..6bc9ef3 100644
--- a/drivers/staging/comedi/drivers/Makefile
+++ b/drivers/staging/comedi/drivers/Makefile
@@ -142,4 +142,3 @@ obj-$(CONFIG_COMEDI_8255)		+= 8255.o
 obj-$(CONFIG_COMEDI_AMPLC_DIO200)	+= amplc_dio200_common.o
 obj-$(CONFIG_COMEDI_AMPLC_PC236)	+= amplc_pc236_common.o
 obj-$(CONFIG_COMEDI_DAS08)		+= das08.o
-obj-$(CONFIG_COMEDI_FC)			+= comedi_fc.o
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
deleted file mode 100644
index 6f99a1e..0000000
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * comedi_fc.c
- * This is a place for code driver writers wish to share between
- * two or more drivers.  fc is short for frank-common.
- *
- * Author: Frank Mori Hess <fmhess@users.sourceforge.net>
- * Copyright (C) 2002 Frank Mori Hess
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/module.h>
-#include "../comedidev.h"
-
-#include "comedi_fc.h"
-
-static int __init comedi_fc_init_module(void)
-{
-	return 0;
-}
-module_init(comedi_fc_init_module);
-
-static void __exit comedi_fc_cleanup_module(void)
-{
-}
-module_exit(comedi_fc_cleanup_module);
-
-MODULE_AUTHOR("Frank Mori Hess <fmhess@users.sourceforge.net>");
-MODULE_DESCRIPTION("Shared functions for Comedi low-level drivers");
-MODULE_LICENSE("GPL");
-- 
2.1.0


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

* [PATCH 11/11] staging: comedi: remove comedi_fc module
@ 2014-09-15 12:46   ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-15 12:46 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Greg Kroah-Hartman, Ian Abbott, linux-kernel

All the exported functions in the "comedi_fc" module have been migrated
to the core "comedi" module and renamed, so it is now just a dummy
module.  Remove it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/Kconfig             | 31 ------------------------
 drivers/staging/comedi/drivers/Makefile    |  1 -
 drivers/staging/comedi/drivers/comedi_fc.c | 38 ------------------------------
 3 files changed, 70 deletions(-)
 delete mode 100644 drivers/staging/comedi/drivers/comedi_fc.c

diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
index fd5f939..ea4948f 100644
--- a/drivers/staging/comedi/Kconfig
+++ b/drivers/staging/comedi/Kconfig
@@ -56,7 +56,6 @@ config COMEDI_BOND
 
 config COMEDI_TEST
 	tristate "Fake waveform generator support"
-	select COMEDI_FC
 	---help---
 	  Enable support for the fake waveform generator.
 	  This driver is mainly for testing purposes, but can also be used to
@@ -170,7 +169,6 @@ config COMEDI_PCL730
 config COMEDI_PCL812
 	tristate "Advantech PCL-812/813 and ADlink ACL-8112/8113/8113/8216"
 	depends on VIRT_TO_BUS && ISA_DMA_API
-	select COMEDI_FC
 	---help---
 	  Enable support for Advantech PCL-812/PG, PCL-813/B, ADLink
 	  ACL-8112DG/HG/PG, ACL-8113, ACL-8216, ICP DAS A-821PGH/PGL/PGL-NDA,
@@ -182,7 +180,6 @@ config COMEDI_PCL812
 config COMEDI_PCL816
 	tristate "Advantech PCL-814 and PCL-816 ISA card support"
 	depends on VIRT_TO_BUS && ISA_DMA_API
-	select COMEDI_FC
 	---help---
 	  Enable support for Advantech PCL-814 and PCL-816 ISA cards
 
@@ -192,7 +189,6 @@ config COMEDI_PCL816
 config COMEDI_PCL818
 	tristate "Advantech PCL-718 and PCL-818 ISA card support"
 	depends on VIRT_TO_BUS && ISA_DMA_API
-	select COMEDI_FC
 	---help---
 	  Enable support for Advantech PCL-818 ISA cards
 	  PCL-818L, PCL-818H, PCL-818HD, PCL-818HG, PCL-818 and PCL-718
@@ -264,7 +260,6 @@ config COMEDI_DAC02
 config COMEDI_DAS16M1
 	tristate "MeasurementComputing CIO-DAS16/M1DAS-16 ISA card support"
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for Measurement Computing CIO-DAS16/M1 ISA cards.
 
@@ -288,7 +283,6 @@ config COMEDI_DAS16
 	tristate "DAS-16 compatible ISA and PC/104 card support"
 	depends on ISA_DMA_API
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for Keithley Metrabyte/ComputerBoards DAS16
 	  and compatible ISA and PC/104 cards:
@@ -304,7 +298,6 @@ config COMEDI_DAS16
 
 config COMEDI_DAS800
 	tristate "DAS800 and compatible ISA card support"
-	select COMEDI_FC
 	---help---
 	  Enable support for Keithley Metrabyte DAS800 and compatible ISA cards
 	  Keithley Metrabyte DAS-800, DAS-801, DAS-802
@@ -317,7 +310,6 @@ config COMEDI_DAS800
 config COMEDI_DAS1800
 	tristate "DAS1800 and compatible ISA card support"
 	depends on VIRT_TO_BUS && ISA_DMA_API
-	select COMEDI_FC
 	---help---
 	  Enable support for DAS1800 and compatible ISA cards
 	  Keithley Metrabyte DAS-1701ST, DAS-1701ST-DA, DAS-1701/AO,
@@ -380,7 +372,6 @@ config COMEDI_DT2817
 
 config COMEDI_DT282X
 	tristate "Data Translation DT2821 series and DT-EZ ISA card support"
-	select COMEDI_FC
 	depends on VIRT_TO_BUS && ISA_DMA_API
 	---help---
 	  Enable support for Data Translation DT2821 series including DT-EZ
@@ -469,7 +460,6 @@ config COMEDI_ADQ12B
 
 config COMEDI_NI_AT_A2150
 	tristate "NI AT-A2150 ISA card support"
-	select COMEDI_FC
 	depends on VIRT_TO_BUS && ISA_DMA_API
 	---help---
 	  Enable support for National Instruments AT-A2150 cards
@@ -489,7 +479,6 @@ config COMEDI_NI_ATMIO
 	tristate "NI AT-MIO E series ISA-PNP card support"
 	select COMEDI_8255
 	select COMEDI_NI_TIO
-	select COMEDI_FC
 	---help---
 	  Enable support for National Instruments AT-MIO E series cards
 	  National Instruments AT-MIO-16E-1 (ni_atmio),
@@ -678,7 +667,6 @@ config COMEDI_ADDI_APCI_2200
 config COMEDI_ADDI_APCI_3120
 	tristate "ADDI-DATA APCI_3120/3001 support"
 	depends on VIRT_TO_BUS
-	select COMEDI_FC
 	---help---
 	  Enable support for ADDI-DATA APCI_3120/3001 cards
 
@@ -730,7 +718,6 @@ config COMEDI_ADL_PCI8164
 
 config COMEDI_ADL_PCI9111
 	tristate "ADLink PCI-9111HR support"
-	select COMEDI_FC
 	---help---
 	  Enable support for ADlink PCI9111 cards
 
@@ -739,7 +726,6 @@ config COMEDI_ADL_PCI9111
 
 config COMEDI_ADL_PCI9118
 	tristate "ADLink PCI-9118DG, PCI-9118HG, PCI-9118HR support"
-	select COMEDI_FC
 	depends on VIRT_TO_BUS
 	---help---
 	  Enable support for ADlink PCI-9118DG, PCI-9118HG, PCI-9118HR cards
@@ -749,7 +735,6 @@ config COMEDI_ADL_PCI9118
 
 config COMEDI_ADV_PCI1710
 	tristate "Advantech PCI-171x, PCI-1720 and PCI-1731 support"
-	select COMEDI_FC
 	---help---
 	  Enable support for Advantech PCI-1710, PCI-1710HG, PCI-1711,
 	  PCI-1713, PCI-1720 and PCI-1731
@@ -817,7 +802,6 @@ config COMEDI_AMPLC_PC263_PCI
 
 config COMEDI_AMPLC_PCI224
 	tristate "Amplicon PCI224 and PCI234 support"
-	select COMEDI_FC
 	---help---
 	  Enable support for Amplicon PCI224 and PCI234 AO boards
 
@@ -853,7 +837,6 @@ config COMEDI_DAS08_PCI
 
 config COMEDI_DT3000
 	tristate "Data Translation DT3000 series support"
-	select COMEDI_FC
 	---help---
 	  Enable support for Data Translation DT3000 series
 	  DT3001, DT3001-PGL, DT3002, DT3003, DT3003-PGL, DT3004, DT3005 and
@@ -873,7 +856,6 @@ config COMEDI_DYNA_PCI10XX
 
 config COMEDI_GSC_HPDI
 	tristate "General Standards PCI-HPDI32 / PMC-HPDI32 support"
-	select COMEDI_FC
 	---help---
 	  Enable support for General Standards Corporation high speed parallel
 	  digital interface rs485 boards PCI-HPDI32 and PMC-HPDI32.
@@ -924,7 +906,6 @@ config COMEDI_KE_COUNTER
 config COMEDI_CB_PCIDAS64
 	tristate "MeasurementComputing PCI-DAS 64xx, 60xx, and 4020 support"
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for ComputerBoards/MeasurementComputing PCI-DAS 64xx,
 	  60xx, and 4020 series with the PLX 9080 PCI controller
@@ -935,7 +916,6 @@ config COMEDI_CB_PCIDAS64
 config COMEDI_CB_PCIDAS
 	tristate "MeasurementComputing PCI-DAS support"
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for ComputerBoards/MeasurementComputing PCI-DAS with
 	  AMCC S5933 PCIcontroller: PCI-DAS1602/16, PCI-DAS1602/16jr,
@@ -1058,7 +1038,6 @@ config COMEDI_NI_PCIMIO
 	depends on HAS_DMA
 	select COMEDI_NI_TIOCMD
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for National Instruments PCI-MIO-E series and M series
 	  (all boards): PCI-MIO-16XE-10, PXI-6030E, PCI-MIO-16E-1,
@@ -1084,7 +1063,6 @@ config COMEDI_RTD520
 
 config COMEDI_S626
 	tristate "Sensoray 626 support"
-	select COMEDI_FC
 	---help---
 	  Enable support for Sensoray 626
 
@@ -1093,7 +1071,6 @@ config COMEDI_S626
 
 config COMEDI_MITE
 	depends on HAS_DMA
-	select COMEDI_FC
 	tristate
 
 config COMEDI_NI_TIOCMD
@@ -1161,7 +1138,6 @@ config COMEDI_NI_MIO_CS
 	tristate "NI DAQCard E series PCMCIA support"
 	select COMEDI_NI_TIO
 	select COMEDI_8255
-	select COMEDI_FC
 	---help---
 	  Enable support for the National Instruments PCMCIA DAQCard E series
 	  DAQCard-ai-16xe-50, DAQCard-ai-16e-4, DAQCard-6062E, DAQCard-6024E
@@ -1172,7 +1148,6 @@ config COMEDI_NI_MIO_CS
 
 config COMEDI_QUATECH_DAQP_CS
 	tristate "Quatech DAQP PCMCIA data capture card support"
-	select COMEDI_FC
 	---help---
 	  Enable support for the Quatech DAQP PCMCIA data capture cards
 	  DAQP-208 and DAQP-308
@@ -1219,7 +1194,6 @@ config COMEDI_USBDUX
 
 config COMEDI_USBDUXFAST
 	tristate "ITL USB-DUXfast support"
-	select COMEDI_FC
 	---help---
 	  Enable support for the Incite Technology Ltd USB-DUXfast Board
 
@@ -1228,7 +1202,6 @@ config COMEDI_USBDUXFAST
 
 config COMEDI_USBDUXSIGMA
 	tristate "ITL USB-DUXsigma support"
-	select COMEDI_FC
 	---help---
 	  Enable support for the Incite Technology Ltd USB-DUXsigma Board
 
@@ -1275,9 +1248,6 @@ config COMEDI_KCOMEDILIB
 	  To compile kcomedilib as a module, choose M here: the module will be
 	  called kcomedilib.
 
-config COMEDI_FC
-	tristate
-
 config COMEDI_AMPLC_DIO200
 	tristate
 
@@ -1292,7 +1262,6 @@ config COMEDI_DAS08
 config COMEDI_NI_LABPC
 	tristate
 	select COMEDI_8255
-	select COMEDI_FC
 
 config COMEDI_NI_LABPC_ISADMA
 	tristate
diff --git a/drivers/staging/comedi/drivers/Makefile b/drivers/staging/comedi/drivers/Makefile
index ba6f6e0..6bc9ef3 100644
--- a/drivers/staging/comedi/drivers/Makefile
+++ b/drivers/staging/comedi/drivers/Makefile
@@ -142,4 +142,3 @@ obj-$(CONFIG_COMEDI_8255)		+= 8255.o
 obj-$(CONFIG_COMEDI_AMPLC_DIO200)	+= amplc_dio200_common.o
 obj-$(CONFIG_COMEDI_AMPLC_PC236)	+= amplc_pc236_common.o
 obj-$(CONFIG_COMEDI_DAS08)		+= das08.o
-obj-$(CONFIG_COMEDI_FC)			+= comedi_fc.o
diff --git a/drivers/staging/comedi/drivers/comedi_fc.c b/drivers/staging/comedi/drivers/comedi_fc.c
deleted file mode 100644
index 6f99a1e..0000000
--- a/drivers/staging/comedi/drivers/comedi_fc.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * comedi_fc.c
- * This is a place for code driver writers wish to share between
- * two or more drivers.  fc is short for frank-common.
- *
- * Author: Frank Mori Hess <fmhess@users.sourceforge.net>
- * Copyright (C) 2002 Frank Mori Hess
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/module.h>
-#include "../comedidev.h"
-
-#include "comedi_fc.h"
-
-static int __init comedi_fc_init_module(void)
-{
-	return 0;
-}
-module_init(comedi_fc_init_module);
-
-static void __exit comedi_fc_cleanup_module(void)
-{
-}
-module_exit(comedi_fc_cleanup_module);
-
-MODULE_AUTHOR("Frank Mori Hess <fmhess@users.sourceforge.net>");
-MODULE_DESCRIPTION("Shared functions for Comedi low-level drivers");
-MODULE_LICENSE("GPL");
-- 
2.1.0

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

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

* RE: [PATCH 11/11] staging: comedi: remove comedi_fc module
  2014-09-15 12:46   ` Ian Abbott
@ 2014-09-15 18:07     ` Hartley Sweeten
  -1 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-15 18:07 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
> All the exported functions in the "comedi_fc" module have been migrated
> to the core "comedi" module and renamed, so it is now just a dummy
> module.  Remove it.
>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
> drivers/staging/comedi/Kconfig             | 31 ------------------------
>  drivers/staging/comedi/drivers/Makefile    |  1 -
>  drivers/staging/comedi/drivers/comedi_fc.c | 38 ------------------------------
>  3 files changed, 70 deletions(-)
>  delete mode 100644 drivers/staging/comedi/drivers/comedi_fc.c
>
> diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
> index fd5f939..ea4948f 100644
> --- a/drivers/staging/comedi/Kconfig
> +++ b/drivers/staging/comedi/Kconfig

[snip]

> @@ -678,7 +667,6 @@ config COMEDI_ADDI_APCI_2200
>  config COMEDI_ADDI_APCI_3120
>  	tristate "ADDI-DATA APCI_3120/3001 support"
>  	depends on VIRT_TO_BUS
> -	select COMEDI_FC
>  	---help---
>  	  Enable support for ADDI-DATA APCI_3120/3001 cards

Ian,

I'm not sure of the patch order for this series and your:
" [PATCH 0/4] staging: comedi: addi_apci_3120: redo DMA buffer allocation"

This patch has a conflict with 3/4 of that series:

config COMEDI_ADDI_APCI_3120
	tristate "ADDI-DATA APCI_3120/3001 support"
	depends on HAS_DMA
	select COMEDI_FC
	---help---
	  Enable support for ADDI-DATA APCI_3120/3001 cards

Regards,
Hartley


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

* RE: [PATCH 11/11] staging: comedi: remove comedi_fc module
@ 2014-09-15 18:07     ` Hartley Sweeten
  0 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-15 18:07 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
> All the exported functions in the "comedi_fc" module have been migrated
> to the core "comedi" module and renamed, so it is now just a dummy
> module.  Remove it.
>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
> drivers/staging/comedi/Kconfig             | 31 ------------------------
>  drivers/staging/comedi/drivers/Makefile    |  1 -
>  drivers/staging/comedi/drivers/comedi_fc.c | 38 ------------------------------
>  3 files changed, 70 deletions(-)
>  delete mode 100644 drivers/staging/comedi/drivers/comedi_fc.c
>
> diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
> index fd5f939..ea4948f 100644
> --- a/drivers/staging/comedi/Kconfig
> +++ b/drivers/staging/comedi/Kconfig

[snip]

> @@ -678,7 +667,6 @@ config COMEDI_ADDI_APCI_2200
>  config COMEDI_ADDI_APCI_3120
>  	tristate "ADDI-DATA APCI_3120/3001 support"
>  	depends on VIRT_TO_BUS
> -	select COMEDI_FC
>  	---help---
>  	  Enable support for ADDI-DATA APCI_3120/3001 cards

Ian,

I'm not sure of the patch order for this series and your:
" [PATCH 0/4] staging: comedi: addi_apci_3120: redo DMA buffer allocation"

This patch has a conflict with 3/4 of that series:

config COMEDI_ADDI_APCI_3120
	tristate "ADDI-DATA APCI_3120/3001 support"
	depends on HAS_DMA
	select COMEDI_FC
	---help---
	  Enable support for ADDI-DATA APCI_3120/3001 cards

Regards,
Hartley

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

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

* RE: [PATCH 01/11] staging: comedi: add comedi_bytes_per_scan()
  2014-09-15 12:45   ` Ian Abbott
@ 2014-09-15 18:12     ` Hartley Sweeten
  -1 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-15 18:12 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
> The "comedi_fc" module contains a few functions useful to Comedi
> drivers.  Their functionality is being migrated to the core "comedi"
> module and renamed to start with the prefix `comedi_`.  As part of this
> migration, move `cfc_bytes_per_scan()` into the core comedi module and
> rename it to `comedi_bytes_per_scan()`.  Change the external declaration
> of `cfc_bytes_per_scan()` into an inline function that calls
> `comedi_bytes_per_scan()`.
>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  drivers/staging/comedi/comedidev.h         |  1 +
>  drivers/staging/comedi/drivers.c           | 37 ++++++++++++++++++++++++++++++
>  drivers/staging/comedi/drivers/comedi_fc.c | 22 ------------------
>  drivers/staging/comedi/drivers/comedi_fc.h |  6 ++++-
>  4 files changed, 43 insertions(+), 23 deletions(-)

Ian,

I think this function should be moved to comedi_buf.c instead.
It's only used by the drivers as part of the async command support.

Regards,
Hartley


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

* RE: [PATCH 01/11] staging: comedi: add comedi_bytes_per_scan()
@ 2014-09-15 18:12     ` Hartley Sweeten
  0 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-15 18:12 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
> The "comedi_fc" module contains a few functions useful to Comedi
> drivers.  Their functionality is being migrated to the core "comedi"
> module and renamed to start with the prefix `comedi_`.  As part of this
> migration, move `cfc_bytes_per_scan()` into the core comedi module and
> rename it to `comedi_bytes_per_scan()`.  Change the external declaration
> of `cfc_bytes_per_scan()` into an inline function that calls
> `comedi_bytes_per_scan()`.
>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  drivers/staging/comedi/comedidev.h         |  1 +
>  drivers/staging/comedi/drivers.c           | 37 ++++++++++++++++++++++++++++++
>  drivers/staging/comedi/drivers/comedi_fc.c | 22 ------------------
>  drivers/staging/comedi/drivers/comedi_fc.h |  6 ++++-
>  4 files changed, 43 insertions(+), 23 deletions(-)

Ian,

I think this function should be moved to comedi_buf.c instead.
It's only used by the drivers as part of the async command support.

Regards,
Hartley

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

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

* RE: [PATCH 03/11] staging: comedi: add comedi_inc_scan_progress()
  2014-09-15 12:45   ` Ian Abbott
@ 2014-09-15 18:14     ` Hartley Sweeten
  -1 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-15 18:14 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
> The "comedi_fc" module contains a few functions useful to Comedi
> drivers.  Their functionality is being migrated to the core "comedi"
> module and renamed to start with the prefix `comedi_`.  As part of this
> migration, move `cfc_inc_scan_progress()` into the core comedi module
> and rename it to `comedi_inc_scan_progress()`.  Change the external
> declaration of `cfc_inc_scan_progress()` into an inline function that
> calls `comedi_inc_scan_progress()`.
>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  drivers/staging/comedi/comedidev.h         |  2 ++
>  drivers/staging/comedi/drivers.c           | 24 ++++++++++++++++++++++++
>  drivers/staging/comedi/drivers/comedi_fc.c | 13 -------------
>  drivers/staging/comedi/drivers/comedi_fc.h |  6 +++++-
>  4 files changed, 31 insertions(+), 14 deletions(-)

Again, I think this function should be in comedi_buf.

Regards,
Hartley


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

* RE: [PATCH 03/11] staging: comedi: add comedi_inc_scan_progress()
@ 2014-09-15 18:14     ` Hartley Sweeten
  0 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-15 18:14 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
> The "comedi_fc" module contains a few functions useful to Comedi
> drivers.  Their functionality is being migrated to the core "comedi"
> module and renamed to start with the prefix `comedi_`.  As part of this
> migration, move `cfc_inc_scan_progress()` into the core comedi module
> and rename it to `comedi_inc_scan_progress()`.  Change the external
> declaration of `cfc_inc_scan_progress()` into an inline function that
> calls `comedi_inc_scan_progress()`.
>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  drivers/staging/comedi/comedidev.h         |  2 ++
>  drivers/staging/comedi/drivers.c           | 24 ++++++++++++++++++++++++
>  drivers/staging/comedi/drivers/comedi_fc.c | 13 -------------
>  drivers/staging/comedi/drivers/comedi_fc.h |  6 +++++-
>  4 files changed, 31 insertions(+), 14 deletions(-)

Again, I think this function should be in comedi_buf.

Regards,
Hartley

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

* RE: [PATCH 05/11] staging: comedi: add comedi_handle_events()
  2014-09-15 12:46   ` Ian Abbott
@ 2014-09-15 18:17     ` Hartley Sweeten
  -1 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-15 18:17 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
> The "comedi_fc" module contains a few functions useful to Comedi
> drivers.  Their functionality is being migrated to the core "comedi"
> module and renamed to start with the prefix `comedi_`.  As part of this
> migration, move `cfc_handle_events()` into the core comedi module and
> rename it to `comedi_handle_events()`.  Change the external declaration
> of `cfc_handle_events()` into an inline function that calls
> `comedi_handle_events()`.
>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  drivers/staging/comedi/comedidev.h         |  3 +++
>  drivers/staging/comedi/drivers.c           | 33 ++++++++++++++++++++++++++++++
>  drivers/staging/comedi/drivers/comedi_fc.c | 17 ---------------
>  drivers/staging/comedi/drivers/comedi_fc.h |  7 +++++--
>  4 files changed, 41 insertions(+), 19 deletions(-)

This one, and comedi_event() in comedi_fops.c should probably
be in comedi_buf.c also.

Regards,
Hartley


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

* RE: [PATCH 05/11] staging: comedi: add comedi_handle_events()
@ 2014-09-15 18:17     ` Hartley Sweeten
  0 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-15 18:17 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
> The "comedi_fc" module contains a few functions useful to Comedi
> drivers.  Their functionality is being migrated to the core "comedi"
> module and renamed to start with the prefix `comedi_`.  As part of this
> migration, move `cfc_handle_events()` into the core comedi module and
> rename it to `comedi_handle_events()`.  Change the external declaration
> of `cfc_handle_events()` into an inline function that calls
> `comedi_handle_events()`.
>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  drivers/staging/comedi/comedidev.h         |  3 +++
>  drivers/staging/comedi/drivers.c           | 33 ++++++++++++++++++++++++++++++
>  drivers/staging/comedi/drivers/comedi_fc.c | 17 ---------------
>  drivers/staging/comedi/drivers/comedi_fc.h |  7 +++++--
>  4 files changed, 41 insertions(+), 19 deletions(-)

This one, and comedi_event() in comedi_fops.c should probably
be in comedi_buf.c also.

Regards,
Hartley

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

* RE: [PATCH 00/11] staging: comedi: move comedi_fc functionality into core
  2014-09-15 12:45 ` Ian Abbott
@ 2014-09-15 18:21   ` Hartley Sweeten
  -1 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-15 18:21 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
> The "comedi_fc" module contains a few functions for use by several
> low-level comedi drivers.  Since they are used by quite a few drivers,
> it seems useful to migrate their functionality to the core "comedi"
> module, renaming them in the process, while keeping the original
> function names in "drivers/comedi_fc.h" available for now.  This set of
> patches accomplishes that.
>
> The next stages after this will be to migrate the remaining inline
> functions from "drivers/comedi_fc.h" (possibly making them externally
> exported functions, although they are rather short), and then to update
> the low-level drivers to call the functions with the new names,
> eliminating the need to include "comedi_fc.h".  Then
> "drivers/comedi_fc.h" can be removed as well.
>
> Note that PATCH 10 has a couple of checkpatch warnings due to
> changing an existing block comment in non-standard block-comment style.
>
> PATCH 11 has a checkpatch warning to check whether MAINTAINERS needs
> updating.  It doesn't.
>
> PATCH 11 might conflict with some other patch series that haven't been
> committed yet.
>
> 01) staging: comedi: add comedi_bytes_per_scan()
> 02) staging: comedi: comedi_fc: use comedi_bytes_per_scan()
> 03) staging: comedi: add comedi_inc_scan_progress()
> 04) staging: comedi: comedi_fc: use comedi_inc_scan_progress()
> 05) staging: comedi: add comedi_handle_events()
> 06) staging: comedi: comedi_fc: cfc_write_array_to_buffer() data is
>     const
> 07) staging: comedi: add comedi_write_array_to_buffer()
> 08) staging: comedi: comedi_fc.h: use comedi_write_array_to_buffer()
> 09) staging: comedi: add comedi_read_array_from_buffer()
> 10) staging: comedi: migrate copyrights from "comedi_fc.c"
> 11) staging: comedi: remove comedi_fc module
>
>  drivers/staging/comedi/Kconfig             |  31 -------
>  drivers/staging/comedi/comedi_buf.c        |  66 +++++++++++++++
>  drivers/staging/comedi/comedidev.h         |  11 +++
>  drivers/staging/comedi/drivers.c           |  95 +++++++++++++++++++++
>  drivers/staging/comedi/drivers/Makefile    |   1 -
>  drivers/staging/comedi/drivers/comedi_fc.c | 132 -----------------------------
>  drivers/staging/comedi/drivers/comedi_fc.h |  40 ++++++---
>  7 files changed, 201 insertions(+), 175 deletions(-)

Ian,

Other than I think the comedi_fc.c functions should be migrated to
comedi_buf.c instead of drivers.c I have not problems with this.

And, patch 11 does have a conflict with your "... use dma_alloc_coherent..."
patches.

But,

Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>


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

* RE: [PATCH 00/11] staging: comedi: move comedi_fc functionality into core
@ 2014-09-15 18:21   ` Hartley Sweeten
  0 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-15 18:21 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
> The "comedi_fc" module contains a few functions for use by several
> low-level comedi drivers.  Since they are used by quite a few drivers,
> it seems useful to migrate their functionality to the core "comedi"
> module, renaming them in the process, while keeping the original
> function names in "drivers/comedi_fc.h" available for now.  This set of
> patches accomplishes that.
>
> The next stages after this will be to migrate the remaining inline
> functions from "drivers/comedi_fc.h" (possibly making them externally
> exported functions, although they are rather short), and then to update
> the low-level drivers to call the functions with the new names,
> eliminating the need to include "comedi_fc.h".  Then
> "drivers/comedi_fc.h" can be removed as well.
>
> Note that PATCH 10 has a couple of checkpatch warnings due to
> changing an existing block comment in non-standard block-comment style.
>
> PATCH 11 has a checkpatch warning to check whether MAINTAINERS needs
> updating.  It doesn't.
>
> PATCH 11 might conflict with some other patch series that haven't been
> committed yet.
>
> 01) staging: comedi: add comedi_bytes_per_scan()
> 02) staging: comedi: comedi_fc: use comedi_bytes_per_scan()
> 03) staging: comedi: add comedi_inc_scan_progress()
> 04) staging: comedi: comedi_fc: use comedi_inc_scan_progress()
> 05) staging: comedi: add comedi_handle_events()
> 06) staging: comedi: comedi_fc: cfc_write_array_to_buffer() data is
>     const
> 07) staging: comedi: add comedi_write_array_to_buffer()
> 08) staging: comedi: comedi_fc.h: use comedi_write_array_to_buffer()
> 09) staging: comedi: add comedi_read_array_from_buffer()
> 10) staging: comedi: migrate copyrights from "comedi_fc.c"
> 11) staging: comedi: remove comedi_fc module
>
>  drivers/staging/comedi/Kconfig             |  31 -------
>  drivers/staging/comedi/comedi_buf.c        |  66 +++++++++++++++
>  drivers/staging/comedi/comedidev.h         |  11 +++
>  drivers/staging/comedi/drivers.c           |  95 +++++++++++++++++++++
>  drivers/staging/comedi/drivers/Makefile    |   1 -
>  drivers/staging/comedi/drivers/comedi_fc.c | 132 -----------------------------
>  drivers/staging/comedi/drivers/comedi_fc.h |  40 ++++++---
>  7 files changed, 201 insertions(+), 175 deletions(-)

Ian,

Other than I think the comedi_fc.c functions should be migrated to
comedi_buf.c instead of drivers.c I have not problems with this.

And, patch 11 does have a conflict with your "... use dma_alloc_coherent..."
patches.

But,

Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>

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

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

* Re: [PATCH 00/11] staging: comedi: move comedi_fc functionality into core
  2014-09-15 18:21   ` Hartley Sweeten
@ 2014-09-16  7:44     ` Ian Abbott
  -1 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-16  7:44 UTC (permalink / raw)
  To: Hartley Sweeten, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On 15/09/14 19:21, Hartley Sweeten wrote:
> On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
>> The "comedi_fc" module contains a few functions for use by several
>> low-level comedi drivers.  Since they are used by quite a few drivers,
>> it seems useful to migrate their functionality to the core "comedi"
>> module, renaming them in the process, while keeping the original
>> function names in "drivers/comedi_fc.h" available for now.  This set of
>> patches accomplishes that.
>>
>> The next stages after this will be to migrate the remaining inline
>> functions from "drivers/comedi_fc.h" (possibly making them externally
>> exported functions, although they are rather short), and then to update
>> the low-level drivers to call the functions with the new names,
>> eliminating the need to include "comedi_fc.h".  Then
>> "drivers/comedi_fc.h" can be removed as well.
>>
>> Note that PATCH 10 has a couple of checkpatch warnings due to
>> changing an existing block comment in non-standard block-comment style.
>>
>> PATCH 11 has a checkpatch warning to check whether MAINTAINERS needs
>> updating.  It doesn't.
>>
>> PATCH 11 might conflict with some other patch series that haven't been
>> committed yet.
>>
>> 01) staging: comedi: add comedi_bytes_per_scan()
>> 02) staging: comedi: comedi_fc: use comedi_bytes_per_scan()
>> 03) staging: comedi: add comedi_inc_scan_progress()
>> 04) staging: comedi: comedi_fc: use comedi_inc_scan_progress()
>> 05) staging: comedi: add comedi_handle_events()
>> 06) staging: comedi: comedi_fc: cfc_write_array_to_buffer() data is
>>      const
>> 07) staging: comedi: add comedi_write_array_to_buffer()
>> 08) staging: comedi: comedi_fc.h: use comedi_write_array_to_buffer()
>> 09) staging: comedi: add comedi_read_array_from_buffer()
>> 10) staging: comedi: migrate copyrights from "comedi_fc.c"
>> 11) staging: comedi: remove comedi_fc module
>>
>>   drivers/staging/comedi/Kconfig             |  31 -------
>>   drivers/staging/comedi/comedi_buf.c        |  66 +++++++++++++++
>>   drivers/staging/comedi/comedidev.h         |  11 +++
>>   drivers/staging/comedi/drivers.c           |  95 +++++++++++++++++++++
>>   drivers/staging/comedi/drivers/Makefile    |   1 -
>>   drivers/staging/comedi/drivers/comedi_fc.c | 132 -----------------------------
>>   drivers/staging/comedi/drivers/comedi_fc.h |  40 ++++++---
>>   7 files changed, 201 insertions(+), 175 deletions(-)
>
> Ian,
>
> Other than I think the comedi_fc.c functions should be migrated to
> comedi_buf.c instead of drivers.c I have not problems with this.

I think it's debatable. The only one of the three functions you 
mentioned that touches the buffer is comedi_inc_scan_progress(), and I'd 
rather keep that with comedi_bytes_per_scan().

> And, patch 11 does have a conflict with your "... use dma_alloc_coherent..."
> patches.

Yes, I'll have to fix up one or the other, depending which gets applied 
first (unless git can magically sort it out with a three way merge).

> But,
>
> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>

Thanks!

-- 
-=( 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] 38+ messages in thread

* Re: [PATCH 00/11] staging: comedi: move comedi_fc functionality into core
@ 2014-09-16  7:44     ` Ian Abbott
  0 siblings, 0 replies; 38+ messages in thread
From: Ian Abbott @ 2014-09-16  7:44 UTC (permalink / raw)
  To: Hartley Sweeten, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On 15/09/14 19:21, Hartley Sweeten wrote:
> On Monday, September 15, 2014 5:46 AM, Ian Abbott wrote:
>> The "comedi_fc" module contains a few functions for use by several
>> low-level comedi drivers.  Since they are used by quite a few drivers,
>> it seems useful to migrate their functionality to the core "comedi"
>> module, renaming them in the process, while keeping the original
>> function names in "drivers/comedi_fc.h" available for now.  This set of
>> patches accomplishes that.
>>
>> The next stages after this will be to migrate the remaining inline
>> functions from "drivers/comedi_fc.h" (possibly making them externally
>> exported functions, although they are rather short), and then to update
>> the low-level drivers to call the functions with the new names,
>> eliminating the need to include "comedi_fc.h".  Then
>> "drivers/comedi_fc.h" can be removed as well.
>>
>> Note that PATCH 10 has a couple of checkpatch warnings due to
>> changing an existing block comment in non-standard block-comment style.
>>
>> PATCH 11 has a checkpatch warning to check whether MAINTAINERS needs
>> updating.  It doesn't.
>>
>> PATCH 11 might conflict with some other patch series that haven't been
>> committed yet.
>>
>> 01) staging: comedi: add comedi_bytes_per_scan()
>> 02) staging: comedi: comedi_fc: use comedi_bytes_per_scan()
>> 03) staging: comedi: add comedi_inc_scan_progress()
>> 04) staging: comedi: comedi_fc: use comedi_inc_scan_progress()
>> 05) staging: comedi: add comedi_handle_events()
>> 06) staging: comedi: comedi_fc: cfc_write_array_to_buffer() data is
>>      const
>> 07) staging: comedi: add comedi_write_array_to_buffer()
>> 08) staging: comedi: comedi_fc.h: use comedi_write_array_to_buffer()
>> 09) staging: comedi: add comedi_read_array_from_buffer()
>> 10) staging: comedi: migrate copyrights from "comedi_fc.c"
>> 11) staging: comedi: remove comedi_fc module
>>
>>   drivers/staging/comedi/Kconfig             |  31 -------
>>   drivers/staging/comedi/comedi_buf.c        |  66 +++++++++++++++
>>   drivers/staging/comedi/comedidev.h         |  11 +++
>>   drivers/staging/comedi/drivers.c           |  95 +++++++++++++++++++++
>>   drivers/staging/comedi/drivers/Makefile    |   1 -
>>   drivers/staging/comedi/drivers/comedi_fc.c | 132 -----------------------------
>>   drivers/staging/comedi/drivers/comedi_fc.h |  40 ++++++---
>>   7 files changed, 201 insertions(+), 175 deletions(-)
>
> Ian,
>
> Other than I think the comedi_fc.c functions should be migrated to
> comedi_buf.c instead of drivers.c I have not problems with this.

I think it's debatable. The only one of the three functions you 
mentioned that touches the buffer is comedi_inc_scan_progress(), and I'd 
rather keep that with comedi_bytes_per_scan().

> And, patch 11 does have a conflict with your "... use dma_alloc_coherent..."
> patches.

Yes, I'll have to fix up one or the other, depending which gets applied 
first (unless git can magically sort it out with a three way merge).

> But,
>
> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>

Thanks!

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* RE: [PATCH 00/11] staging: comedi: move comedi_fc functionality into core
  2014-09-16  7:44     ` Ian Abbott
@ 2014-09-16 16:13       ` Hartley Sweeten
  -1 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-16 16:13 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Tuesday, September 16, 2014 12:44 AM, Ian Abbott wrote:
> On 15/09/14 19:21, Hartley Sweeten wrote:
>> Other than I think the comedi_fc.c functions should be migrated to
>> comedi_buf.c instead of drivers.c I have not problems with this.
>
> I think it's debatable. The only one of the three functions you 
> mentioned that touches the buffer is comedi_inc_scan_progress(), and I'd 
> rather keep that with comedi_bytes_per_scan().

Fair enough. I might end up moving some of them later based on some patches
I'm working on, but for now having them in drivers.c is fine.

>> And, patch 11 does have a conflict with your "... use dma_alloc_coherent..."
>> patches.
>
> Yes, I'll have to fix up one or the other, depending which gets applied 
> first (unless git can magically sort it out with a three way merge).

If not it's an easy rebase.

Regards,
Hartley


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

* RE: [PATCH 00/11] staging: comedi: move comedi_fc functionality into core
@ 2014-09-16 16:13       ` Hartley Sweeten
  0 siblings, 0 replies; 38+ messages in thread
From: Hartley Sweeten @ 2014-09-16 16:13 UTC (permalink / raw)
  To: Ian Abbott, driverdev-devel; +Cc: Greg Kroah-Hartman, linux-kernel

On Tuesday, September 16, 2014 12:44 AM, Ian Abbott wrote:
> On 15/09/14 19:21, Hartley Sweeten wrote:
>> Other than I think the comedi_fc.c functions should be migrated to
>> comedi_buf.c instead of drivers.c I have not problems with this.
>
> I think it's debatable. The only one of the three functions you 
> mentioned that touches the buffer is comedi_inc_scan_progress(), and I'd 
> rather keep that with comedi_bytes_per_scan().

Fair enough. I might end up moving some of them later based on some patches
I'm working on, but for now having them in drivers.c is fine.

>> And, patch 11 does have a conflict with your "... use dma_alloc_coherent..."
>> patches.
>
> Yes, I'll have to fix up one or the other, depending which gets applied 
> first (unless git can magically sort it out with a three way merge).

If not it's an easy rebase.

Regards,
Hartley

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

end of thread, other threads:[~2014-09-16 16:13 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-15 12:45 [PATCH 00/11] staging: comedi: move comedi_fc functionality into core Ian Abbott
2014-09-15 12:45 ` Ian Abbott
2014-09-15 12:45 ` [PATCH 01/11] staging: comedi: add comedi_bytes_per_scan() Ian Abbott
2014-09-15 12:45   ` Ian Abbott
2014-09-15 18:12   ` Hartley Sweeten
2014-09-15 18:12     ` Hartley Sweeten
2014-09-15 12:45 ` [PATCH 02/11] staging: comedi: comedi_fc: use comedi_bytes_per_scan() Ian Abbott
2014-09-15 12:45   ` Ian Abbott
2014-09-15 12:45 ` [PATCH 03/11] staging: comedi: add comedi_inc_scan_progress() Ian Abbott
2014-09-15 12:45   ` Ian Abbott
2014-09-15 18:14   ` Hartley Sweeten
2014-09-15 18:14     ` Hartley Sweeten
2014-09-15 12:46 ` [PATCH 04/11] staging: comedi: comedi_fc: use comedi_inc_scan_progress() Ian Abbott
2014-09-15 12:46   ` Ian Abbott
2014-09-15 12:46 ` [PATCH 05/11] staging: comedi: add comedi_handle_events() Ian Abbott
2014-09-15 12:46   ` Ian Abbott
2014-09-15 18:17   ` Hartley Sweeten
2014-09-15 18:17     ` Hartley Sweeten
2014-09-15 12:46 ` [PATCH 06/11] staging: comedi: comedi_fc: cfc_write_array_to_buffer() data is const Ian Abbott
2014-09-15 12:46   ` Ian Abbott
2014-09-15 12:46 ` [PATCH 07/11] staging: comedi: add comedi_write_array_to_buffer() Ian Abbott
2014-09-15 12:46   ` Ian Abbott
2014-09-15 12:46 ` [PATCH 08/11] staging: comedi: comedi_fc.h: use comedi_write_array_to_buffer() Ian Abbott
2014-09-15 12:46   ` Ian Abbott
2014-09-15 12:46 ` [PATCH 09/11] staging: comedi: add comedi_read_array_from_buffer() Ian Abbott
2014-09-15 12:46   ` Ian Abbott
2014-09-15 12:46 ` [PATCH 10/11] staging: comedi: migrate copyrights from "comedi_fc.c" Ian Abbott
2014-09-15 12:46   ` Ian Abbott
2014-09-15 12:46 ` [PATCH 11/11] staging: comedi: remove comedi_fc module Ian Abbott
2014-09-15 12:46   ` Ian Abbott
2014-09-15 18:07   ` Hartley Sweeten
2014-09-15 18:07     ` Hartley Sweeten
2014-09-15 18:21 ` [PATCH 00/11] staging: comedi: move comedi_fc functionality into core Hartley Sweeten
2014-09-15 18:21   ` Hartley Sweeten
2014-09-16  7:44   ` Ian Abbott
2014-09-16  7:44     ` Ian Abbott
2014-09-16 16:13     ` Hartley Sweeten
2014-09-16 16:13       ` Hartley Sweeten

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.