[PATCH v2 9/16] staging: comedi: ni_stc.h: the boardinfo 'name' should be first

H Hartley Sweeten hsweeten at visionengravers.com
Thu Jun 26 17:13:08 UTC 2014


By convention, the first member of the boardinfo is a 'const char *' to
the board name, especially for those comedi drivers that rely on the
comedi core to set dev->board_ptr to the entry matching the board name
when doing a legacy (*attach) to a comedi driver.

Modify the ni_board_struct appropriately for consistency, although the
board name is only used for informational purposes by this driver (only
the driver name is matched by the comedi core).

For aesthetics, also move the members in the boardinfo declarations.

Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregk at linuxfoundation.org>
---
v2: modify commit message based on comments from Ian Abbott
    patches 1-8 and 10-16 have not changed

 drivers/staging/comedi/drivers/ni_atmio.c  | 16 ++++++++--------
 drivers/staging/comedi/drivers/ni_mio_cs.c | 12 ++++++------
 drivers/staging/comedi/drivers/ni_stc.h    |  2 +-
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_atmio.c b/drivers/staging/comedi/drivers/ni_atmio.c
index 3ea49c7..230879f 100644
--- a/drivers/staging/comedi/drivers/ni_atmio.c
+++ b/drivers/staging/comedi/drivers/ni_atmio.c
@@ -107,9 +107,9 @@ are not supported.
 
 static const struct ni_board_struct ni_boards[] = {
 	{
+		.name		= "at-mio-16e-1",
 		.device_id	= 44,
 		.isapnp_id	= 0x0000,	/* XXX unknown */
-		.name		= "at-mio-16e-1",
 		.n_adchan	= 16,
 		.adbits		= 12,
 		.ai_fifo_depth	= 8192,
@@ -124,9 +124,9 @@ static const struct ni_board_struct ni_boards[] = {
 		.num_p0_dio_channels = 8,
 		.caldac		= { mb88341 },
 	}, {
+		.name		= "at-mio-16e-2",
 		.device_id	= 25,
 		.isapnp_id	= 0x1900,
-		.name		= "at-mio-16e-2",
 		.n_adchan	= 16,
 		.adbits		= 12,
 		.ai_fifo_depth	= 2048,
@@ -141,9 +141,9 @@ static const struct ni_board_struct ni_boards[] = {
 		.num_p0_dio_channels = 8,
 		.caldac		= { mb88341 },
 	}, {
+		.name		= "at-mio-16e-10",
 		.device_id	= 36,
 		.isapnp_id	= 0x2400,
-		.name		= "at-mio-16e-10",
 		.n_adchan	= 16,
 		.adbits		= 12,
 		.ai_fifo_depth	= 512,
@@ -157,9 +157,9 @@ static const struct ni_board_struct ni_boards[] = {
 		.num_p0_dio_channels = 8,
 		.caldac		= { ad8804_debug },
 	}, {
+		.name		= "at-mio-16de-10",
 		.device_id	= 37,
 		.isapnp_id	= 0x2500,
-		.name		= "at-mio-16de-10",
 		.n_adchan	= 16,
 		.adbits		= 12,
 		.ai_fifo_depth	= 512,
@@ -174,9 +174,9 @@ static const struct ni_board_struct ni_boards[] = {
 		.caldac		= { ad8804_debug },
 		.has_8255	= 1,
 	}, {
+		.name		= "at-mio-64e-3",
 		.device_id	= 38,
 		.isapnp_id	= 0x2600,
-		.name		= "at-mio-64e-3",
 		.n_adchan	= 64,
 		.adbits		= 12,
 		.ai_fifo_depth	= 2048,
@@ -191,9 +191,9 @@ static const struct ni_board_struct ni_boards[] = {
 		.num_p0_dio_channels = 8,
 		.caldac		= { ad8804_debug },
 	}, {
+		.name		= "at-mio-16xe-50",
 		.device_id	= 39,
 		.isapnp_id	= 0x2700,
-		.name		= "at-mio-16xe-50",
 		.n_adchan	= 16,
 		.adbits		= 16,
 		.ai_fifo_depth	= 512,
@@ -207,9 +207,9 @@ static const struct ni_board_struct ni_boards[] = {
 		.num_p0_dio_channels = 8,
 		.caldac		= { dac8800, dac8043 },
 	}, {
+		.name		= "at-mio-16xe-10",
 		.device_id	= 50,
 		.isapnp_id	= 0x0000,	/* XXX unknown */
-		.name		= "at-mio-16xe-10",
 		.n_adchan	= 16,
 		.adbits		= 16,
 		.ai_fifo_depth	= 512,
@@ -225,9 +225,9 @@ static const struct ni_board_struct ni_boards[] = {
 		.num_p0_dio_channels = 8,
 		.caldac		= { dac8800, dac8043, ad8522 },
 	}, {
+		.name		= "at-ai-16xe-10",
 		.device_id	= 51,
 		.isapnp_id	= 0x0000,	/* XXX unknown */
-		.name		= "at-ai-16xe-10",
 		.n_adchan	= 16,
 		.adbits		= 16,
 		.ai_fifo_depth	= 512,
diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c
index f6cab5c..f58be63 100644
--- a/drivers/staging/comedi/drivers/ni_mio_cs.c
+++ b/drivers/staging/comedi/drivers/ni_mio_cs.c
@@ -56,8 +56,8 @@ See the notes in the ni_atmio.o driver.
 
 static const struct ni_board_struct ni_boards[] = {
 	{
-		.device_id	= 0x010d,
 		.name		= "DAQCard-ai-16xe-50",
+		.device_id	= 0x010d,
 		.n_adchan	= 16,
 		.adbits		= 16,
 		.ai_fifo_depth	= 1024,
@@ -66,8 +66,8 @@ static const struct ni_board_struct ni_boards[] = {
 		.num_p0_dio_channels = 8,
 		.caldac		= { dac8800, dac8043 },
 	}, {
-		.device_id	= 0x010c,
 		.name		= "DAQCard-ai-16e-4",
+		.device_id	= 0x010c,
 		.n_adchan	= 16,
 		.adbits		= 12,
 		.ai_fifo_depth	= 1024,
@@ -76,8 +76,8 @@ static const struct ni_board_struct ni_boards[] = {
 		.num_p0_dio_channels = 8,
 		.caldac		= { mb88341 },		/* verified */
 	}, {
-		.device_id	= 0x02c4,
 		.name		= "DAQCard-6062E",
+		.device_id	= 0x02c4,
 		.n_adchan	= 16,
 		.adbits		= 12,
 		.ai_fifo_depth	= 8192,
@@ -92,8 +92,8 @@ static const struct ni_board_struct ni_boards[] = {
 		.caldac		= { ad8804_debug },	/* verified */
 	 }, {
 		/* specs incorrect! */
-		.device_id	= 0x075e,
 		.name		= "DAQCard-6024E",
+		.device_id	= 0x075e,
 		.n_adchan	= 16,
 		.adbits		= 12,
 		.ai_fifo_depth	= 1024,
@@ -107,8 +107,8 @@ static const struct ni_board_struct ni_boards[] = {
 		.caldac		= { ad8804_debug },
 	}, {
 		/* specs incorrect! */
-		.device_id	= 0x0245,
 		.name		= "DAQCard-6036E",
+		.device_id	= 0x0245,
 		.n_adchan	= 16,
 		.adbits		= 16,
 		.ai_fifo_depth	= 1024,
@@ -124,8 +124,8 @@ static const struct ni_board_struct ni_boards[] = {
 	 },
 #if 0
 	{
-		.device_id	= 0x0000,	/* unknown */
 		.name		= "DAQCard-6715",
+		.device_id	= 0x0000,	/* unknown */
 		.n_aochan	= 8,
 		.aobits		= 12,
 		.ao_671x	= 8192,
diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h
index 7cb591a..02a7fa3 100644
--- a/drivers/staging/comedi/drivers/ni_stc.h
+++ b/drivers/staging/comedi/drivers/ni_stc.h
@@ -1388,9 +1388,9 @@ enum Interrupt_C_Status_Bits {
 #define M_SERIES_EEPROM_SIZE 1024
 
 struct ni_board_struct {
+	const char *name;
 	int device_id;
 	int isapnp_id;
-	char *name;
 
 	int n_adchan;
 	int adbits;
-- 
1.9.3



More information about the devel mailing list