[PATCH 04/13] staging: comedi: amplc_dio200_pci: remove 'mainsize' from PCI boardinfo

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

 



The 'mainsize' member in the boardinfo for the DIO200 PCI boards is only used
for a sanity check of the pci_resource_len(). This sanity check is not needed.

Remove the sanity check along with the 'mainsize' 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/amplc_dio200.h     | 4 ----
 drivers/staging/comedi/drivers/amplc_dio200_pci.c | 9 ---------
 2 files changed, 13 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_dio200.h b/drivers/staging/comedi/drivers/amplc_dio200.h
index dec7d6e..13e18e1 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200.h
+++ b/drivers/staging/comedi/drivers/amplc_dio200.h
@@ -23,10 +23,6 @@
 #ifndef AMPLC_DIO200_H_INCLUDED
 #define AMPLC_DIO200_H_INCLUDED
 
-/* 200 series register area sizes */
-#define DIO200_IO_SIZE		0x20
-#define DIO200_PCIE_IO_SIZE	0x4000
-
 /*
  * Subdevice types.
  */
diff --git a/drivers/staging/comedi/drivers/amplc_dio200_pci.c b/drivers/staging/comedi/drivers/amplc_dio200_pci.c
index 9e7bc00..52e5acf 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_pci.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_pci.c
@@ -244,7 +244,6 @@ static const struct dio200_board dio200_pci_boards[] = {
 	[pci215_model] = {
 		.name = "pci215",
 		.mainbar = 2,
-		.mainsize = DIO200_IO_SIZE,
 		.layout = {
 			.n_subdevs = 5,
 			.sdtype = {sd_8255, sd_8255, sd_8254, sd_8254, sd_intr},
@@ -256,7 +255,6 @@ static const struct dio200_board dio200_pci_boards[] = {
 	[pci272_model] = {
 		.name = "pci272",
 		.mainbar = 2,
-		.mainsize = DIO200_IO_SIZE,
 		.layout = {
 			.n_subdevs = 4,
 			.sdtype = {sd_8255, sd_8255, sd_8255, sd_intr},
@@ -268,7 +266,6 @@ static const struct dio200_board dio200_pci_boards[] = {
 		.name = "pcie215",
 		.mainbar = 1,
 		.mainshift = 3,
-		.mainsize = DIO200_PCIE_IO_SIZE,
 		.layout = {
 			.n_subdevs = 8,
 			.sdtype = {sd_8255, sd_none, sd_8255, sd_none,
@@ -284,7 +281,6 @@ static const struct dio200_board dio200_pci_boards[] = {
 		.name = "pcie236",
 		.mainbar = 1,
 		.mainshift = 3,
-		.mainsize = DIO200_PCIE_IO_SIZE,
 		.layout = {
 			.n_subdevs = 8,
 			.sdtype = {sd_8255, sd_none, sd_none, sd_none,
@@ -300,7 +296,6 @@ static const struct dio200_board dio200_pci_boards[] = {
 		.name = "pcie296",
 		.mainbar = 1,
 		.mainshift = 3,
-		.mainsize = DIO200_PCIE_IO_SIZE,
 		.layout = {
 			.n_subdevs = 8,
 			.sdtype = {sd_8255, sd_8255, sd_8255, sd_8255,
@@ -372,10 +367,6 @@ static int dio200_pci_auto_attach(struct comedi_device *dev,
 		return ret;
 
 	bar = thisboard->mainbar;
-	if (pci_resource_len(pci_dev, bar) < thisboard->mainsize) {
-		dev_err(dev->class_dev, "error! PCI region size too small!\n");
-		return -EINVAL;
-	}
 	if (pci_resource_flags(pci_dev, bar) & IORESOURCE_MEM) {
 		dev->mmio = pci_ioremap_bar(pci_dev, bar);
 		if (!dev->mmio) {
-- 
2.0.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