diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-06-27 18:57:16 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2008-07-16 17:27:07 -0400 |
commit | bbe413b4fc7f791248c7ee00ce7b3778491a3700 (patch) | |
tree | 5225313f499012fa30419092ad8532a458531dc2 /drivers/pnp | |
parent | e2a1a6f1cfaf6ee770a8700e5df8a3708dae503b (diff) |
ISAPNP: handle independent options following dependent ones
The ISAPNP spec recommends that independent options precede
dependent ones, but this is not actually required. The current
ISAPNP code incorrectly puts such trailing independent options
at the end of the last dependent option list.
This patch fixes that bug by resetting the current option list
to the independent list when we see an "End Dependent Functions"
tag. PNPBIOS and PNPACPI handle this the same way.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/isapnp/core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index 90718be66463..53cc4d6133e6 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c | |||
@@ -584,14 +584,14 @@ static int __init isapnp_create_device(struct pnp_card *card, | |||
584 | { | 584 | { |
585 | int number = 0, skip = 0, priority, compat = 0; | 585 | int number = 0, skip = 0, priority, compat = 0; |
586 | unsigned char type, tmp[17]; | 586 | unsigned char type, tmp[17]; |
587 | struct pnp_option *option; | 587 | struct pnp_option *option, *option_independent; |
588 | struct pnp_dev *dev; | 588 | struct pnp_dev *dev; |
589 | u32 eisa_id; | 589 | u32 eisa_id; |
590 | char id[8]; | 590 | char id[8]; |
591 | 591 | ||
592 | if ((dev = isapnp_parse_device(card, size, number++)) == NULL) | 592 | if ((dev = isapnp_parse_device(card, size, number++)) == NULL) |
593 | return 1; | 593 | return 1; |
594 | option = pnp_register_independent_option(dev); | 594 | option_independent = option = pnp_register_independent_option(dev); |
595 | if (!option) { | 595 | if (!option) { |
596 | kfree(dev); | 596 | kfree(dev); |
597 | return 1; | 597 | return 1; |
@@ -613,6 +613,7 @@ static int __init isapnp_create_device(struct pnp_card *card, | |||
613 | size = 0; | 613 | size = 0; |
614 | skip = 0; | 614 | skip = 0; |
615 | option = pnp_register_independent_option(dev); | 615 | option = pnp_register_independent_option(dev); |
616 | option_independent = option; | ||
616 | if (!option) { | 617 | if (!option) { |
617 | kfree(dev); | 618 | kfree(dev); |
618 | return 1; | 619 | return 1; |
@@ -662,6 +663,10 @@ static int __init isapnp_create_device(struct pnp_card *card, | |||
662 | case _STAG_ENDDEP: | 663 | case _STAG_ENDDEP: |
663 | if (size != 0) | 664 | if (size != 0) |
664 | goto __skip; | 665 | goto __skip; |
666 | if (option_independent == option) | ||
667 | dev_warn(&dev->dev, "missing " | ||
668 | "_STAG_STARTDEP tag\n"); | ||
669 | option = option_independent; | ||
665 | dev_dbg(&dev->dev, "end dependent options\n"); | 670 | dev_dbg(&dev->dev, "end dependent options\n"); |
666 | break; | 671 | break; |
667 | case _STAG_IOPORT: | 672 | case _STAG_IOPORT: |