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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The comedi core expects the first member of the boardinfo to be a
'const char *' to the board name. The comedi_recognize() function
uses this to locate the correct boardinfo when doing a legacy
(*attach) to a comedi driver.

Modify the ni_board_struct appropriately.

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

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregk@xxxxxxxxxxxxxxxxxxx>
---
 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

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




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux