[PATCH 1/6] staging: comedi: pcl730: tidy up the boardinfo

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

 



Convert the boardinfo declaration to C99 format and move it near the
struct definition.

Since the *_SIZE defines are only used in the boardinfo, remove them
and just open code the values in the boardinfo.

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

diff --git a/drivers/staging/comedi/drivers/pcl730.c b/drivers/staging/comedi/drivers/pcl730.c
index 2879db7..c6b6001 100644
--- a/drivers/staging/comedi/drivers/pcl730.c
+++ b/drivers/staging/comedi/drivers/pcl730.c
@@ -19,19 +19,29 @@ The ACL-7130 card have an 8254 timer/counter not supported by this driver.
 
 #include <linux/ioport.h>
 
-#define PCL730_SIZE		4
-#define ACL7130_SIZE	8
 #define PCL730_IDIO_LO	0	/* Isolated Digital I/O low byte (ID0-ID7) */
 #define PCL730_IDIO_HI	1	/* Isolated Digital I/O high byte (ID8-ID15) */
 #define PCL730_DIO_LO	2	/* TTL Digital I/O low byte (D0-D7) */
 #define PCL730_DIO_HI	3	/* TTL Digital I/O high byte (D8-D15) */
 
 struct pcl730_board {
-
 	const char *name;	/*  board name */
 	unsigned int io_range;	/*  len of I/O space */
 };
 
+static const struct pcl730_board boardtypes[] = {
+	{
+		.name		= "pcl730",
+		.io_range	= 0x04,
+	}, {
+		.name		= "iso730",
+		.io_range	= 0x04,
+	}, {
+		.name		= "acl7130",
+		.io_range	= 0x08,
+	},
+};
+
 static int pcl730_do_insn(struct comedi_device *dev, struct comedi_subdevice *s,
 			  struct comedi_insn *insn, unsigned int *data)
 {
@@ -119,12 +129,6 @@ static int pcl730_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	return 0;
 }
 
-static const struct pcl730_board boardtypes[] = {
-	{ "pcl730", PCL730_SIZE, },
-	{ "iso730", PCL730_SIZE, },
-	{ "acl7130", ACL7130_SIZE, },
-};
-
 static struct comedi_driver pcl730_driver = {
 	.driver_name	= "pcl730",
 	.module		= THIS_MODULE,
-- 
1.8.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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