aboutsummaryrefslogtreecommitdiff
path: root/drivers/pnp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/isapnp/core.c25
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c8
2 files changed, 21 insertions, 12 deletions
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index 2c925b7cd93..257f5d827d8 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -88,6 +88,15 @@ MODULE_LICENSE("GPL");
#define _LTAG_MEM32RANGE 0x85
#define _LTAG_FIXEDMEM32RANGE 0x86
+/*
+ * Sizes of ISAPNP logical device configuration register sets.
+ * See PNP-ISA-v1.0a.pdf, Appendix A.
+ */
+#define ISAPNP_MAX_MEM 4
+#define ISAPNP_MAX_PORT 8
+#define ISAPNP_MAX_IRQ 2
+#define ISAPNP_MAX_DMA 2
+
static unsigned char isapnp_checksum_value;
static DEFINE_MUTEX(isapnp_cfg_mutex);
static int isapnp_csn_count;
@@ -945,14 +954,14 @@ static int isapnp_read_resources(struct pnp_dev *dev,
dev->active = isapnp_read_byte(ISAPNP_CFG_ACTIVATE);
if (dev->active) {
- for (tmp = 0; tmp < PNP_MAX_PORT; tmp++) {
+ for (tmp = 0; tmp < ISAPNP_MAX_PORT; tmp++) {
ret = isapnp_read_word(ISAPNP_CFG_PORT + (tmp << 1));
if (!ret)
continue;
res->port_resource[tmp].start = ret;
res->port_resource[tmp].flags = IORESOURCE_IO;
}
- for (tmp = 0; tmp < PNP_MAX_MEM; tmp++) {
+ for (tmp = 0; tmp < ISAPNP_MAX_MEM; tmp++) {
ret =
isapnp_read_word(ISAPNP_CFG_MEM + (tmp << 3)) << 8;
if (!ret)
@@ -960,7 +969,7 @@ static int isapnp_read_resources(struct pnp_dev *dev,
res->mem_resource[tmp].start = ret;
res->mem_resource[tmp].flags = IORESOURCE_MEM;
}
- for (tmp = 0; tmp < PNP_MAX_IRQ; tmp++) {
+ for (tmp = 0; tmp < ISAPNP_MAX_IRQ; tmp++) {
ret =
(isapnp_read_word(ISAPNP_CFG_IRQ + (tmp << 1)) >>
8);
@@ -970,7 +979,7 @@ static int isapnp_read_resources(struct pnp_dev *dev,
res->irq_resource[tmp].end = ret;
res->irq_resource[tmp].flags = IORESOURCE_IRQ;
}
- for (tmp = 0; tmp < PNP_MAX_DMA; tmp++) {
+ for (tmp = 0; tmp < ISAPNP_MAX_DMA; tmp++) {
ret = isapnp_read_byte(ISAPNP_CFG_DMA + tmp);
if (ret == 4)
continue;
@@ -1002,14 +1011,14 @@ static int isapnp_set_resources(struct pnp_dev *dev,
isapnp_cfg_begin(dev->card->number, dev->number);
dev->active = 1;
for (tmp = 0;
- tmp < PNP_MAX_PORT
+ tmp < ISAPNP_MAX_PORT
&& (res->port_resource[tmp].
flags & (IORESOURCE_IO | IORESOURCE_UNSET)) == IORESOURCE_IO;
tmp++)
isapnp_write_word(ISAPNP_CFG_PORT + (tmp << 1),
res->port_resource[tmp].start);
for (tmp = 0;
- tmp < PNP_MAX_IRQ
+ tmp < ISAPNP_MAX_IRQ
&& (res->irq_resource[tmp].
flags & (IORESOURCE_IRQ | IORESOURCE_UNSET)) == IORESOURCE_IRQ;
tmp++) {
@@ -1019,14 +1028,14 @@ static int isapnp_set_resources(struct pnp_dev *dev,
isapnp_write_byte(ISAPNP_CFG_IRQ + (tmp << 1), irq);
}
for (tmp = 0;
- tmp < PNP_MAX_DMA
+ tmp < ISAPNP_MAX_DMA
&& (res->dma_resource[tmp].
flags & (IORESOURCE_DMA | IORESOURCE_UNSET)) == IORESOURCE_DMA;
tmp++)
isapnp_write_byte(ISAPNP_CFG_DMA + tmp,
res->dma_resource[tmp].start);
for (tmp = 0;
- tmp < PNP_MAX_MEM
+ tmp < ISAPNP_MAX_MEM
&& (res->mem_resource[tmp].
flags & (IORESOURCE_MEM | IORESOURCE_UNSET)) == IORESOURCE_MEM;
tmp++)
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 6aa231ef642..2dcd1960aca 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -85,7 +85,7 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
i < PNP_MAX_IRQ)
i++;
if (i >= PNP_MAX_IRQ && !warned) {
- printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ "
+ printk(KERN_WARNING "pnpacpi: exceeded the max number of IRQ "
"resources: %d \n", PNP_MAX_IRQ);
warned = 1;
return;
@@ -187,7 +187,7 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
res->dma_resource[i].start = dma;
res->dma_resource[i].end = dma;
} else if (!warned) {
- printk(KERN_ERR "pnpacpi: exceeded the max number of DMA "
+ printk(KERN_WARNING "pnpacpi: exceeded the max number of DMA "
"resources: %d \n", PNP_MAX_DMA);
warned = 1;
}
@@ -213,7 +213,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
res->port_resource[i].start = io;
res->port_resource[i].end = io + len - 1;
} else if (!warned) {
- printk(KERN_ERR "pnpacpi: exceeded the max number of IO "
+ printk(KERN_WARNING "pnpacpi: exceeded the max number of IO "
"resources: %d \n", PNP_MAX_PORT);
warned = 1;
}
@@ -241,7 +241,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
res->mem_resource[i].start = mem;
res->mem_resource[i].end = mem + len - 1;
} else if (!warned) {
- printk(KERN_ERR "pnpacpi: exceeded the max number of mem "
+ printk(KERN_WARNING "pnpacpi: exceeded the max number of mem "
"resources: %d\n", PNP_MAX_MEM);
warned = 1;
}