[PATCH 01/31] staging: comedi: pcl711: convert boardinfo declaration to C99 format

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

 



Convert the boardinfo declaration to C99 format to make it less error
prone and easier to maintain.

For aesthetics, move the declaration closer to the struct definition.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/pcl711.c | 52 ++++++++++++++++++++++++++++-----
 1 file changed, 44 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl711.c b/drivers/staging/comedi/drivers/pcl711.c
index 53cd1af..c7d7684 100644
--- a/drivers/staging/comedi/drivers/pcl711.c
+++ b/drivers/staging/comedi/drivers/pcl711.c
@@ -132,7 +132,6 @@ static const struct comedi_lrange range_acl8112dg_ai = { 9, {
 static const int i8253_osc_base = 500;	/* 2 Mhz */
 
 struct pcl711_board {
-
 	const char *name;
 	int is_pcl711b;
 	int is_8112;
@@ -144,6 +143,50 @@ struct pcl711_board {
 	const struct comedi_lrange *ai_range_type;
 };
 
+static const struct pcl711_board boardtypes[] = {
+	{
+		.name		= "pcl711",
+		.is_pcl711b	= 0,
+		.is_8112	= 0,
+		.is_dg		= 0,
+		.n_ranges	= 5,
+		.n_aichan	= 8,
+		.n_aochan	= 1,
+		.maxirq		= 0,
+		.ai_range_type	= &range_bipolar5,
+	}, {
+		.name		= "pcl711b",
+		.is_pcl711b	= 1,
+		.is_8112	= 0,
+		.is_dg		= 0,
+		.n_ranges	= 5,
+		.n_aichan	= 8,
+		.n_aochan	= 1,
+		.maxirq		= 7,
+		.ai_range_type	= &range_pcl711b_ai,
+	}, {
+		.name		= "acl8112hg",
+		.is_pcl711b	= 0,
+		.is_8112	= 1,
+		.is_dg		= 0,
+		.n_ranges	= 12,
+		.n_aichan	= 16,
+		.n_aochan	= 2,
+		.maxirq		= 15,
+		.ai_range_type	= &range_acl8112hg_ai,
+	}, {
+		.name		= "acl8112dg",
+		.is_pcl711b	= 0,
+		.is_8112	= 1,
+		.is_dg		= 1,
+		.n_ranges	= 9,
+		.n_aichan	= 16,
+		.n_aochan	= 2,
+		.maxirq		= 15,
+		.ai_range_type	= &range_acl8112dg_ai,
+	},
+};
+
 struct pcl711_private {
 
 	int board;
@@ -545,13 +588,6 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	return 0;
 }
 
-static const struct pcl711_board boardtypes[] = {
-	{ "pcl711", 0, 0, 0, 5, 8, 1, 0, &range_bipolar5 },
-	{ "pcl711b", 1, 0, 0, 5, 8, 1, 7, &range_pcl711b_ai },
-	{ "acl8112hg", 0, 1, 0, 12, 16, 2, 15, &range_acl8112hg_ai },
-	{ "acl8112dg", 0, 1, 1, 9, 16, 2, 15, &range_acl8112dg_ai },
-};
-
 static struct comedi_driver pcl711_driver = {
 	.driver_name	= "pcl711",
 	.module		= THIS_MODULE,
-- 
1.8.3.2

_______________________________________________
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