[PATCH 1/9] staging: comedi: das08: Use IS_ENABLED()

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

 



Change conditional compilation on kernel config options to use the
IS_ENABLED() macro.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
 drivers/staging/comedi/drivers/das08.c |   50 +++++++++++++-------------------
 1 files changed, 20 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 1f31943..3f81a00 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -61,17 +61,7 @@
 
 #define DRV_NAME "das08"
 
-#ifdef CONFIG_COMEDI_DAS08_ISA_MODULE
-#define CONFIG_COMEDI_DAS08_ISA
-#endif
-#ifdef CONFIG_COMEDI_DAS08_PCI_MODULE
-#define CONFIG_COMEDI_DAS08_PCI
-#endif
-#ifdef CONFIG_COMEDI_DAS08_CS_MODULE
-#define CONFIG_COMEDI_DAS08_CS
-#endif
-
-#if defined(CONFIG_COMEDI_DAS08_ISA) || defined(CONFIG_COMEDI_DAS08_PCI)
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_ISA) || IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
 #define DO_COMEDI_DRIVER_REGISTER
 #endif
 
@@ -174,7 +164,7 @@ static int das08_di_rbits(struct comedi_device *dev, struct comedi_subdevice *s,
 			  struct comedi_insn *insn, unsigned int *data);
 static int das08_do_wbits(struct comedi_device *dev, struct comedi_subdevice *s,
 			  struct comedi_insn *insn, unsigned int *data);
-#ifdef CONFIG_COMEDI_DAS08_ISA
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_ISA)
 static int das08jr_di_rbits(struct comedi_device *dev,
 			    struct comedi_subdevice *s,
 			    struct comedi_insn *insn, unsigned int *data);
@@ -271,7 +261,7 @@ static const int *const das08_gainlists[] = {
 
 #ifdef DO_COMEDI_DRIVER_REGISTER
 static const struct das08_board_struct das08_boards[] = {
-#ifdef CONFIG_COMEDI_DAS08_ISA
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_ISA)
 	{
 	 .name = "isa-das08",	/*  cio-das08.pdf */
 	 .bustype = isa,
@@ -461,8 +451,8 @@ static const struct das08_board_struct das08_boards[] = {
 	 .name = "das08-pga-g2",	/*  a KM board */
 	 },
 #endif
-#endif /* CONFIG_COMEDI_DAS08_ISA */
-#ifdef CONFIG_COMEDI_DAS08_PCI
+#endif /* IS_ENABLED(CONFIG_COMEDI_DAS08_ISA) */
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
 	{
 	 .name = "das08",	/*  pci-das08 */
 	 .id = PCI_DEVICE_ID_PCIDAS08,
@@ -480,11 +470,11 @@ static const struct das08_board_struct das08_boards[] = {
 	 .i8254_offset = 4,
 	 .iosize = 8,
 	 },
-#endif /* CONFIG_COMEDI_DAS08_PCI */
+#endif /* IS_ENABLED(CONFIG_COMEDI_DAS08_PCI) */
 };
 #endif /* DO_COMEDI_DRIVER_REGISTER */
 
-#ifdef CONFIG_COMEDI_DAS08_CS
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_CS)
 struct das08_board_struct das08_cs_boards[NUM_DAS08_CS_BOARDS] = {
 	{
 	 .name = "pcm-das08",
@@ -524,7 +514,7 @@ struct das08_board_struct das08_cs_boards[NUM_DAS08_CS_BOARDS] = {
 };
 #endif
 
-#ifdef CONFIG_COMEDI_DAS08_PCI
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
 static DEFINE_PCI_DEVICE_TABLE(das08_pci_table) = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_COMPUTERBOARDS, PCI_DEVICE_ID_PCIDAS08) },
 	{0}
@@ -639,7 +629,7 @@ static int das08_do_wbits(struct comedi_device *dev, struct comedi_subdevice *s,
 	return 2;
 }
 
-#ifdef CONFIG_COMEDI_DAS08_ISA
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_ISA)
 static int das08jr_di_rbits(struct comedi_device *dev,
 			    struct comedi_subdevice *s,
 			    struct comedi_insn *insn, unsigned int *data)
@@ -651,7 +641,7 @@ static int das08jr_di_rbits(struct comedi_device *dev,
 }
 #endif
 
-#ifdef CONFIG_COMEDI_DAS08_ISA
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_ISA)
 static int das08jr_do_wbits(struct comedi_device *dev,
 			    struct comedi_subdevice *s,
 			    struct comedi_insn *insn, unsigned int *data)
@@ -668,7 +658,7 @@ static int das08jr_do_wbits(struct comedi_device *dev,
 }
 #endif
 
-#ifdef CONFIG_COMEDI_DAS08_ISA
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_ISA)
 static int das08jr_ao_winsn(struct comedi_device *dev,
 			    struct comedi_subdevice *s,
 			    struct comedi_insn *insn, unsigned int *data)
@@ -705,7 +695,7 @@ static int das08jr_ao_winsn(struct comedi_device *dev,
  * a different method to force an update.
  *
  */
-#ifdef CONFIG_COMEDI_DAS08_ISA
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_ISA)
 static int das08ao_ao_winsn(struct comedi_device *dev,
 			    struct comedi_subdevice *s,
 			    struct comedi_insn *insn, unsigned int *data)
@@ -1007,7 +997,7 @@ static int das08_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
 	int ret;
 	unsigned long iobase;
-#ifdef CONFIG_COMEDI_DAS08_PCI
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
 	unsigned long pci_iobase = 0;
 	struct pci_dev *pdev = NULL;
 #endif
@@ -1017,7 +1007,7 @@ static int das08_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		return ret;
 
 	printk(KERN_INFO "comedi%d: das08: ", dev->minor);
-#ifdef CONFIG_COMEDI_DAS08_PCI
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
 	/*  deal with a pci board */
 	if (thisboard->bustype == pci) {
 		if (it->options[0] || it->options[1]) {
@@ -1069,7 +1059,7 @@ static int das08_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		outw(INTR1_ENABLE | PCI_INTR_ENABLE, pci_iobase + INTCSR);
 #endif
 	} else
-#endif /* CONFIG_COMEDI_DAS08_PCI */
+#endif /* IS_ENABLED(CONFIG_COMEDI_DAS08_PCI) */
 	{
 		iobase = it->options[0];
 	}
@@ -1087,7 +1077,7 @@ void das08_common_detach(struct comedi_device *dev)
 		if (dev->iobase)
 			release_region(dev->iobase, thisboard->iosize);
 	}
-#ifdef CONFIG_COMEDI_DAS08_PCI
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
 	if (devpriv) {
 		if (devpriv->pdev) {
 			if (devpriv->pci_iobase)
@@ -1100,7 +1090,7 @@ void das08_common_detach(struct comedi_device *dev)
 }
 EXPORT_SYMBOL_GPL(das08_common_detach);
 
-#ifdef CONFIG_COMEDI_DAS08_PCI
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
 static int __devinit driver_das08_pci_probe(struct pci_dev *dev,
 					    const struct pci_device_id *ent)
 {
@@ -1128,7 +1118,7 @@ static int __init driver_das08_init_module(void)
 	if (retval < 0)
 		return retval;
 #endif
-#ifdef CONFIG_COMEDI_DAS08_PCI
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
 	driver_das08_pci_driver.name = (char *)driver_das08.driver_name;
 	retval = pci_register_driver(&driver_das08_pci_driver);
 #endif
@@ -1137,7 +1127,7 @@ static int __init driver_das08_init_module(void)
 
 static void __exit driver_das08_cleanup_module(void)
 {
-#ifdef CONFIG_COMEDI_DAS08_PCI
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
 	pci_unregister_driver(&driver_das08_pci_driver);
 #endif
 #ifdef DO_COMEDI_DRIVER_REGISTER
@@ -1148,7 +1138,7 @@ static void __exit driver_das08_cleanup_module(void)
 module_init(driver_das08_init_module);
 module_exit(driver_das08_cleanup_module);
 
-#ifdef CONFIG_COMEDI_DAS08_CS
+#if IS_ENABLED(CONFIG_COMEDI_DAS08_CS)
 EXPORT_SYMBOL_GPL(das08_cs_boards);
 #endif
 
-- 
1.7.8.6

_______________________________________________
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