aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-07 13:13:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-07 13:13:52 -0500
commit3c00303206c3a1ccd86579efdc90bc35f140962e (patch)
tree66170c84b5ddaeb102aea3530517a26657b6ea29 /drivers/pnp
parent83dbb15e9cd78a3619e3db36777e2f81d09b2914 (diff)
parentefb90582c575084723cc14302c1300cb26c7e01f (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: cpuidle: Single/Global registration of idle states cpuidle: Split cpuidle_state structure and move per-cpu statistics fields cpuidle: Remove CPUIDLE_FLAG_IGNORE and dev->prepare() cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state ACPI: Fix CONFIG_ACPI_DOCK=n compiler warning ACPI: Export FADT pm_profile integer value to userspace thermal: Prevent polling from happening during system suspend ACPI: Drop ACPI_NO_HARDWARE_INIT ACPI atomicio: Convert width in bits to bytes in __acpi_ioremap_fast() PNPACPI: Simplify disabled resource registration ACPI: Fix possible recursive locking in hwregs.c ACPI: use kstrdup() mrst pmu: update comment tools/power turbostat: less verbose debugging
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c62
1 files changed, 15 insertions, 47 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index bbf3edd85beb..5be4a392a3ae 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -509,15 +509,12 @@ static __init void pnpacpi_parse_dma_option(struct pnp_dev *dev,
509 struct acpi_resource_dma *p) 509 struct acpi_resource_dma *p)
510{ 510{
511 int i; 511 int i;
512 unsigned char map = 0, flags = 0; 512 unsigned char map = 0, flags;
513
514 if (p->channel_count == 0)
515 flags |= IORESOURCE_DISABLED;
516 513
517 for (i = 0; i < p->channel_count; i++) 514 for (i = 0; i < p->channel_count; i++)
518 map |= 1 << p->channels[i]; 515 map |= 1 << p->channels[i];
519 516
520 flags |= dma_flags(dev, p->type, p->bus_master, p->transfer); 517 flags = dma_flags(dev, p->type, p->bus_master, p->transfer);
521 pnp_register_dma_resource(dev, option_flags, map, flags); 518 pnp_register_dma_resource(dev, option_flags, map, flags);
522} 519}
523 520
@@ -527,17 +524,14 @@ static __init void pnpacpi_parse_irq_option(struct pnp_dev *dev,
527{ 524{
528 int i; 525 int i;
529 pnp_irq_mask_t map; 526 pnp_irq_mask_t map;
530 unsigned char flags = 0; 527 unsigned char flags;
531
532 if (p->interrupt_count == 0)
533 flags |= IORESOURCE_DISABLED;
534 528
535 bitmap_zero(map.bits, PNP_IRQ_NR); 529 bitmap_zero(map.bits, PNP_IRQ_NR);
536 for (i = 0; i < p->interrupt_count; i++) 530 for (i = 0; i < p->interrupt_count; i++)
537 if (p->interrupts[i]) 531 if (p->interrupts[i])
538 __set_bit(p->interrupts[i], map.bits); 532 __set_bit(p->interrupts[i], map.bits);
539 533
540 flags |= irq_flags(p->triggering, p->polarity, p->sharable); 534 flags = irq_flags(p->triggering, p->polarity, p->sharable);
541 pnp_register_irq_resource(dev, option_flags, &map, flags); 535 pnp_register_irq_resource(dev, option_flags, &map, flags);
542} 536}
543 537
@@ -547,10 +541,7 @@ static __init void pnpacpi_parse_ext_irq_option(struct pnp_dev *dev,
547{ 541{
548 int i; 542 int i;
549 pnp_irq_mask_t map; 543 pnp_irq_mask_t map;
550 unsigned char flags = 0; 544 unsigned char flags;
551
552 if (p->interrupt_count == 0)
553 flags |= IORESOURCE_DISABLED;
554 545
555 bitmap_zero(map.bits, PNP_IRQ_NR); 546 bitmap_zero(map.bits, PNP_IRQ_NR);
556 for (i = 0; i < p->interrupt_count; i++) { 547 for (i = 0; i < p->interrupt_count; i++) {
@@ -564,7 +555,7 @@ static __init void pnpacpi_parse_ext_irq_option(struct pnp_dev *dev,
564 } 555 }
565 } 556 }
566 557
567 flags |= irq_flags(p->triggering, p->polarity, p->sharable); 558 flags = irq_flags(p->triggering, p->polarity, p->sharable);
568 pnp_register_irq_resource(dev, option_flags, &map, flags); 559 pnp_register_irq_resource(dev, option_flags, &map, flags);
569} 560}
570 561
@@ -574,11 +565,8 @@ static __init void pnpacpi_parse_port_option(struct pnp_dev *dev,
574{ 565{
575 unsigned char flags = 0; 566 unsigned char flags = 0;
576 567
577 if (io->address_length == 0)
578 flags |= IORESOURCE_DISABLED;
579
580 if (io->io_decode == ACPI_DECODE_16) 568 if (io->io_decode == ACPI_DECODE_16)
581 flags |= IORESOURCE_IO_16BIT_ADDR; 569 flags = IORESOURCE_IO_16BIT_ADDR;
582 pnp_register_port_resource(dev, option_flags, io->minimum, io->maximum, 570 pnp_register_port_resource(dev, option_flags, io->minimum, io->maximum,
583 io->alignment, io->address_length, flags); 571 io->alignment, io->address_length, flags);
584} 572}
@@ -587,13 +575,8 @@ static __init void pnpacpi_parse_fixed_port_option(struct pnp_dev *dev,
587 unsigned int option_flags, 575 unsigned int option_flags,
588 struct acpi_resource_fixed_io *io) 576 struct acpi_resource_fixed_io *io)
589{ 577{
590 unsigned char flags = 0;
591
592 if (io->address_length == 0)
593 flags |= IORESOURCE_DISABLED;
594
595 pnp_register_port_resource(dev, option_flags, io->address, io->address, 578 pnp_register_port_resource(dev, option_flags, io->address, io->address,
596 0, io->address_length, flags | IORESOURCE_IO_FIXED); 579 0, io->address_length, IORESOURCE_IO_FIXED);
597} 580}
598 581
599static __init void pnpacpi_parse_mem24_option(struct pnp_dev *dev, 582static __init void pnpacpi_parse_mem24_option(struct pnp_dev *dev,
@@ -602,11 +585,8 @@ static __init void pnpacpi_parse_mem24_option(struct pnp_dev *dev,
602{ 585{
603 unsigned char flags = 0; 586 unsigned char flags = 0;
604 587
605 if (p->address_length == 0)
606 flags |= IORESOURCE_DISABLED;
607
608 if (p->write_protect == ACPI_READ_WRITE_MEMORY) 588 if (p->write_protect == ACPI_READ_WRITE_MEMORY)
609 flags |= IORESOURCE_MEM_WRITEABLE; 589 flags = IORESOURCE_MEM_WRITEABLE;
610 pnp_register_mem_resource(dev, option_flags, p->minimum, p->maximum, 590 pnp_register_mem_resource(dev, option_flags, p->minimum, p->maximum,
611 p->alignment, p->address_length, flags); 591 p->alignment, p->address_length, flags);
612} 592}
@@ -617,11 +597,8 @@ static __init void pnpacpi_parse_mem32_option(struct pnp_dev *dev,
617{ 597{
618 unsigned char flags = 0; 598 unsigned char flags = 0;
619 599
620 if (p->address_length == 0)
621 flags |= IORESOURCE_DISABLED;
622
623 if (p->write_protect == ACPI_READ_WRITE_MEMORY) 600 if (p->write_protect == ACPI_READ_WRITE_MEMORY)
624 flags |= IORESOURCE_MEM_WRITEABLE; 601 flags = IORESOURCE_MEM_WRITEABLE;
625 pnp_register_mem_resource(dev, option_flags, p->minimum, p->maximum, 602 pnp_register_mem_resource(dev, option_flags, p->minimum, p->maximum,
626 p->alignment, p->address_length, flags); 603 p->alignment, p->address_length, flags);
627} 604}
@@ -632,11 +609,8 @@ static __init void pnpacpi_parse_fixed_mem32_option(struct pnp_dev *dev,
632{ 609{
633 unsigned char flags = 0; 610 unsigned char flags = 0;
634 611
635 if (p->address_length == 0)
636 flags |= IORESOURCE_DISABLED;
637
638 if (p->write_protect == ACPI_READ_WRITE_MEMORY) 612 if (p->write_protect == ACPI_READ_WRITE_MEMORY)
639 flags |= IORESOURCE_MEM_WRITEABLE; 613 flags = IORESOURCE_MEM_WRITEABLE;
640 pnp_register_mem_resource(dev, option_flags, p->address, p->address, 614 pnp_register_mem_resource(dev, option_flags, p->address, p->address,
641 0, p->address_length, flags); 615 0, p->address_length, flags);
642} 616}
@@ -656,19 +630,16 @@ static __init void pnpacpi_parse_address_option(struct pnp_dev *dev,
656 return; 630 return;
657 } 631 }
658 632
659 if (p->address_length == 0)
660 flags |= IORESOURCE_DISABLED;
661
662 if (p->resource_type == ACPI_MEMORY_RANGE) { 633 if (p->resource_type == ACPI_MEMORY_RANGE) {
663 if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY) 634 if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY)
664 flags |= IORESOURCE_MEM_WRITEABLE; 635 flags = IORESOURCE_MEM_WRITEABLE;
665 pnp_register_mem_resource(dev, option_flags, p->minimum, 636 pnp_register_mem_resource(dev, option_flags, p->minimum,
666 p->minimum, 0, p->address_length, 637 p->minimum, 0, p->address_length,
667 flags); 638 flags);
668 } else if (p->resource_type == ACPI_IO_RANGE) 639 } else if (p->resource_type == ACPI_IO_RANGE)
669 pnp_register_port_resource(dev, option_flags, p->minimum, 640 pnp_register_port_resource(dev, option_flags, p->minimum,
670 p->minimum, 0, p->address_length, 641 p->minimum, 0, p->address_length,
671 flags | IORESOURCE_IO_FIXED); 642 IORESOURCE_IO_FIXED);
672} 643}
673 644
674static __init void pnpacpi_parse_ext_address_option(struct pnp_dev *dev, 645static __init void pnpacpi_parse_ext_address_option(struct pnp_dev *dev,
@@ -678,19 +649,16 @@ static __init void pnpacpi_parse_ext_address_option(struct pnp_dev *dev,
678 struct acpi_resource_extended_address64 *p = &r->data.ext_address64; 649 struct acpi_resource_extended_address64 *p = &r->data.ext_address64;
679 unsigned char flags = 0; 650 unsigned char flags = 0;
680 651
681 if (p->address_length == 0)
682 flags |= IORESOURCE_DISABLED;
683
684 if (p->resource_type == ACPI_MEMORY_RANGE) { 652 if (p->resource_type == ACPI_MEMORY_RANGE) {
685 if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY) 653 if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY)
686 flags |= IORESOURCE_MEM_WRITEABLE; 654 flags = IORESOURCE_MEM_WRITEABLE;
687 pnp_register_mem_resource(dev, option_flags, p->minimum, 655 pnp_register_mem_resource(dev, option_flags, p->minimum,
688 p->minimum, 0, p->address_length, 656 p->minimum, 0, p->address_length,
689 flags); 657 flags);
690 } else if (p->resource_type == ACPI_IO_RANGE) 658 } else if (p->resource_type == ACPI_IO_RANGE)
691 pnp_register_port_resource(dev, option_flags, p->minimum, 659 pnp_register_port_resource(dev, option_flags, p->minimum,
692 p->minimum, 0, p->address_length, 660 p->minimum, 0, p->address_length,
693 flags | IORESOURCE_IO_FIXED); 661 IORESOURCE_IO_FIXED);
694} 662}
695 663
696struct acpipnp_parse_option_s { 664struct acpipnp_parse_option_s {