aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpacpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp/pnpacpi')
-rw-r--r--drivers/pnp/pnpacpi/core.c2
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c60
2 files changed, 35 insertions, 27 deletions
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index dada89906314..662b4c279cfc 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -183,7 +183,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
183 if (ACPI_SUCCESS(status)) 183 if (ACPI_SUCCESS(status))
184 dev->capabilities |= PNP_CONFIGURABLE; 184 dev->capabilities |= PNP_CONFIGURABLE;
185 dev->capabilities |= PNP_READ; 185 dev->capabilities |= PNP_READ;
186 if (device->flags.dynamic_status) 186 if (device->flags.dynamic_status && (dev->capabilities & PNP_CONFIGURABLE))
187 dev->capabilities |= PNP_WRITE; 187 dev->capabilities |= PNP_WRITE;
188 if (device->flags.removable) 188 if (device->flags.removable)
189 dev->capabilities |= PNP_REMOVABLE; 189 dev->capabilities |= PNP_REMOVABLE;
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 3c5eb374adf8..6aa231ef642d 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -76,6 +76,7 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
76 int i = 0; 76 int i = 0;
77 int irq; 77 int irq;
78 int p, t; 78 int p, t;
79 static unsigned char warned;
79 80
80 if (!valid_IRQ(gsi)) 81 if (!valid_IRQ(gsi))
81 return; 82 return;
@@ -83,9 +84,10 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
83 while (!(res->irq_resource[i].flags & IORESOURCE_UNSET) && 84 while (!(res->irq_resource[i].flags & IORESOURCE_UNSET) &&
84 i < PNP_MAX_IRQ) 85 i < PNP_MAX_IRQ)
85 i++; 86 i++;
86 if (i >= PNP_MAX_IRQ) { 87 if (i >= PNP_MAX_IRQ && !warned) {
87 printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ " 88 printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ "
88 "resources: %d \n", PNP_MAX_IRQ); 89 "resources: %d \n", PNP_MAX_IRQ);
90 warned = 1;
89 return; 91 return;
90 } 92 }
91 /* 93 /*
@@ -169,6 +171,7 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
169 int bus_master, int transfer) 171 int bus_master, int transfer)
170{ 172{
171 int i = 0; 173 int i = 0;
174 static unsigned char warned;
172 175
173 while (i < PNP_MAX_DMA && 176 while (i < PNP_MAX_DMA &&
174 !(res->dma_resource[i].flags & IORESOURCE_UNSET)) 177 !(res->dma_resource[i].flags & IORESOURCE_UNSET))
@@ -183,9 +186,10 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
183 } 186 }
184 res->dma_resource[i].start = dma; 187 res->dma_resource[i].start = dma;
185 res->dma_resource[i].end = dma; 188 res->dma_resource[i].end = dma;
186 } else { 189 } else if (!warned) {
187 printk(KERN_ERR "pnpacpi: exceeded the max number of DMA " 190 printk(KERN_ERR "pnpacpi: exceeded the max number of DMA "
188 "resources: %d \n", PNP_MAX_DMA); 191 "resources: %d \n", PNP_MAX_DMA);
192 warned = 1;
189 } 193 }
190} 194}
191 195
@@ -193,6 +197,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
193 u64 io, u64 len, int io_decode) 197 u64 io, u64 len, int io_decode)
194{ 198{
195 int i = 0; 199 int i = 0;
200 static unsigned char warned;
196 201
197 while (!(res->port_resource[i].flags & IORESOURCE_UNSET) && 202 while (!(res->port_resource[i].flags & IORESOURCE_UNSET) &&
198 i < PNP_MAX_PORT) 203 i < PNP_MAX_PORT)
@@ -207,9 +212,10 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
207 } 212 }
208 res->port_resource[i].start = io; 213 res->port_resource[i].start = io;
209 res->port_resource[i].end = io + len - 1; 214 res->port_resource[i].end = io + len - 1;
210 } else { 215 } else if (!warned) {
211 printk(KERN_ERR "pnpacpi: exceeded the max number of IO " 216 printk(KERN_ERR "pnpacpi: exceeded the max number of IO "
212 "resources: %d \n", PNP_MAX_PORT); 217 "resources: %d \n", PNP_MAX_PORT);
218 warned = 1;
213 } 219 }
214} 220}
215 221
@@ -218,6 +224,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
218 int write_protect) 224 int write_protect)
219{ 225{
220 int i = 0; 226 int i = 0;
227 static unsigned char warned;
221 228
222 while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) && 229 while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) &&
223 (i < PNP_MAX_MEM)) 230 (i < PNP_MAX_MEM))
@@ -233,9 +240,10 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
233 240
234 res->mem_resource[i].start = mem; 241 res->mem_resource[i].start = mem;
235 res->mem_resource[i].end = mem + len - 1; 242 res->mem_resource[i].end = mem + len - 1;
236 } else { 243 } else if (!warned) {
237 printk(KERN_ERR "pnpacpi: exceeded the max number of mem " 244 printk(KERN_ERR "pnpacpi: exceeded the max number of mem "
238 "resources: %d\n", PNP_MAX_MEM); 245 "resources: %d\n", PNP_MAX_MEM);
246 warned = 1;
239 } 247 }
240} 248}
241 249
@@ -383,8 +391,8 @@ acpi_status pnpacpi_parse_allocated_resource(acpi_handle handle,
383 pnpacpi_allocated_resource, res); 391 pnpacpi_allocated_resource, res);
384} 392}
385 393
386static void pnpacpi_parse_dma_option(struct pnp_option *option, 394static __init void pnpacpi_parse_dma_option(struct pnp_option *option,
387 struct acpi_resource_dma *p) 395 struct acpi_resource_dma *p)
388{ 396{
389 int i; 397 int i;
390 struct pnp_dma *dma; 398 struct pnp_dma *dma;
@@ -403,8 +411,8 @@ static void pnpacpi_parse_dma_option(struct pnp_option *option,
403 pnp_register_dma_resource(option, dma); 411 pnp_register_dma_resource(option, dma);
404} 412}
405 413
406static void pnpacpi_parse_irq_option(struct pnp_option *option, 414static __init void pnpacpi_parse_irq_option(struct pnp_option *option,
407 struct acpi_resource_irq *p) 415 struct acpi_resource_irq *p)
408{ 416{
409 int i; 417 int i;
410 struct pnp_irq *irq; 418 struct pnp_irq *irq;
@@ -423,8 +431,8 @@ static void pnpacpi_parse_irq_option(struct pnp_option *option,
423 pnp_register_irq_resource(option, irq); 431 pnp_register_irq_resource(option, irq);
424} 432}
425 433
426static void pnpacpi_parse_ext_irq_option(struct pnp_option *option, 434static __init void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
427 struct acpi_resource_extended_irq *p) 435 struct acpi_resource_extended_irq *p)
428{ 436{
429 int i; 437 int i;
430 struct pnp_irq *irq; 438 struct pnp_irq *irq;
@@ -443,8 +451,8 @@ static void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
443 pnp_register_irq_resource(option, irq); 451 pnp_register_irq_resource(option, irq);
444} 452}
445 453
446static void pnpacpi_parse_port_option(struct pnp_option *option, 454static __init void pnpacpi_parse_port_option(struct pnp_option *option,
447 struct acpi_resource_io *io) 455 struct acpi_resource_io *io)
448{ 456{
449 struct pnp_port *port; 457 struct pnp_port *port;
450 458
@@ -462,8 +470,8 @@ static void pnpacpi_parse_port_option(struct pnp_option *option,
462 pnp_register_port_resource(option, port); 470 pnp_register_port_resource(option, port);
463} 471}
464 472
465static void pnpacpi_parse_fixed_port_option(struct pnp_option *option, 473static __init void pnpacpi_parse_fixed_port_option(struct pnp_option *option,
466 struct acpi_resource_fixed_io *io) 474 struct acpi_resource_fixed_io *io)
467{ 475{
468 struct pnp_port *port; 476 struct pnp_port *port;
469 477
@@ -479,8 +487,8 @@ static void pnpacpi_parse_fixed_port_option(struct pnp_option *option,
479 pnp_register_port_resource(option, port); 487 pnp_register_port_resource(option, port);
480} 488}
481 489
482static void pnpacpi_parse_mem24_option(struct pnp_option *option, 490static __init void pnpacpi_parse_mem24_option(struct pnp_option *option,
483 struct acpi_resource_memory24 *p) 491 struct acpi_resource_memory24 *p)
484{ 492{
485 struct pnp_mem *mem; 493 struct pnp_mem *mem;
486 494
@@ -500,8 +508,8 @@ static void pnpacpi_parse_mem24_option(struct pnp_option *option,
500 pnp_register_mem_resource(option, mem); 508 pnp_register_mem_resource(option, mem);
501} 509}
502 510
503static void pnpacpi_parse_mem32_option(struct pnp_option *option, 511static __init void pnpacpi_parse_mem32_option(struct pnp_option *option,
504 struct acpi_resource_memory32 *p) 512 struct acpi_resource_memory32 *p)
505{ 513{
506 struct pnp_mem *mem; 514 struct pnp_mem *mem;
507 515
@@ -521,8 +529,8 @@ static void pnpacpi_parse_mem32_option(struct pnp_option *option,
521 pnp_register_mem_resource(option, mem); 529 pnp_register_mem_resource(option, mem);
522} 530}
523 531
524static void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option, 532static __init void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
525 struct acpi_resource_fixed_memory32 *p) 533 struct acpi_resource_fixed_memory32 *p)
526{ 534{
527 struct pnp_mem *mem; 535 struct pnp_mem *mem;
528 536
@@ -541,8 +549,8 @@ static void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
541 pnp_register_mem_resource(option, mem); 549 pnp_register_mem_resource(option, mem);
542} 550}
543 551
544static void pnpacpi_parse_address_option(struct pnp_option *option, 552static __init void pnpacpi_parse_address_option(struct pnp_option *option,
545 struct acpi_resource *r) 553 struct acpi_resource *r)
546{ 554{
547 struct acpi_resource_address64 addr, *p = &addr; 555 struct acpi_resource_address64 addr, *p = &addr;
548 acpi_status status; 556 acpi_status status;
@@ -588,8 +596,8 @@ struct acpipnp_parse_option_s {
588 struct pnp_dev *dev; 596 struct pnp_dev *dev;
589}; 597};
590 598
591static acpi_status pnpacpi_option_resource(struct acpi_resource *res, 599static __init acpi_status pnpacpi_option_resource(struct acpi_resource *res,
592 void *data) 600 void *data)
593{ 601{
594 int priority = 0; 602 int priority = 0;
595 struct acpipnp_parse_option_s *parse_data = data; 603 struct acpipnp_parse_option_s *parse_data = data;
@@ -688,8 +696,8 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
688 return AE_OK; 696 return AE_OK;
689} 697}
690 698
691acpi_status pnpacpi_parse_resource_option_data(acpi_handle handle, 699acpi_status __init pnpacpi_parse_resource_option_data(acpi_handle handle,
692 struct pnp_dev * dev) 700 struct pnp_dev *dev)
693{ 701{
694 acpi_status status; 702 acpi_status status;
695 struct acpipnp_parse_option_s parse_data; 703 struct acpipnp_parse_option_s parse_data;