[PATCH 10/12] staging: comedi: amplc_dio200: don't check bus-type in dio200_common_attach()

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

 



The "amplc_dio200" driver is going to be split into separate drivers for
ISA and PCI cards with a common module containing most of the code.  We
don't want the common module code to depend on whether ISA boards, PCI
boards, or both are supported.  Currently, `dio200_common_attach()` and
`dio200_detach()` optimize out the code to support a timer subdevice
when built to support ISA boards only.  Remove the `if (DO_PCI)` tests
which optimize out that code.  Unfortunately, this will expand the
module's code size for an ISA-only driver a bit.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
 drivers/staging/comedi/drivers/amplc_dio200.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_dio200.c b/drivers/staging/comedi/drivers/amplc_dio200.c
index eb0d3c1..3802678 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200.c
@@ -1747,14 +1747,9 @@ static int dio200_common_attach(struct comedi_device *dev, unsigned int irq,
 			}
 			break;
 		case sd_timer:
-			/* Only on PCIe boards. */
-			if (DO_PCI) {
-				ret = dio200_subdev_timer_init(dev, s);
-				if (ret < 0)
-					return ret;
-			} else {
-				s->type = COMEDI_SUBD_UNUSED;
-			}
+			ret = dio200_subdev_timer_init(dev, s);
+			if (ret < 0)
+				return ret;
 			break;
 		default:
 			s->type = COMEDI_SUBD_UNUSED;
@@ -1904,9 +1899,7 @@ static void dio200_detach(struct comedi_device *dev)
 				dio200_subdev_intr_cleanup(dev, s);
 				break;
 			case sd_timer:
-				/* Only on PCIe boards. */
-				if (DO_PCI)
-					dio200_subdev_timer_cleanup(dev, s);
+				dio200_subdev_timer_cleanup(dev, s);
 				break;
 			default:
 				break;
-- 
1.8.1.5

_______________________________________________
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