aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpbios
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp/pnpbios')
-rw-r--r--drivers/pnp/pnpbios/rsparser.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c
index 4390e3b41df0..c1f9e162d2c5 100644
--- a/drivers/pnp/pnpbios/rsparser.c
+++ b/drivers/pnp/pnpbios/rsparser.c
@@ -688,7 +688,6 @@ static unsigned char *pnpbios_encode_allocated_resource_data(struct pnp_dev
688 unsigned char *p, 688 unsigned char *p,
689 unsigned char *end) 689 unsigned char *end)
690{ 690{
691 struct pnp_resource_table *res = &dev->res;
692 unsigned int len, tag; 691 unsigned int len, tag;
693 int port = 0, irq = 0, dma = 0, mem = 0; 692 int port = 0, irq = 0, dma = 0, mem = 0;
694 693
@@ -711,42 +710,48 @@ static unsigned char *pnpbios_encode_allocated_resource_data(struct pnp_dev
711 case LARGE_TAG_MEM: 710 case LARGE_TAG_MEM:
712 if (len != 9) 711 if (len != 9)
713 goto len_err; 712 goto len_err;
714 pnpbios_encode_mem(dev, p, &res->mem_resource[mem]); 713 pnpbios_encode_mem(dev, p,
714 pnp_get_resource(dev, IORESOURCE_MEM, mem));
715 mem++; 715 mem++;
716 break; 716 break;
717 717
718 case LARGE_TAG_MEM32: 718 case LARGE_TAG_MEM32:
719 if (len != 17) 719 if (len != 17)
720 goto len_err; 720 goto len_err;
721 pnpbios_encode_mem32(dev, p, &res->mem_resource[mem]); 721 pnpbios_encode_mem32(dev, p,
722 pnp_get_resource(dev, IORESOURCE_MEM, mem));
722 mem++; 723 mem++;
723 break; 724 break;
724 725
725 case LARGE_TAG_FIXEDMEM32: 726 case LARGE_TAG_FIXEDMEM32:
726 if (len != 9) 727 if (len != 9)
727 goto len_err; 728 goto len_err;
728 pnpbios_encode_fixed_mem32(dev, p, &res->mem_resource[mem]); 729 pnpbios_encode_fixed_mem32(dev, p,
730 pnp_get_resource(dev, IORESOURCE_MEM, mem));
729 mem++; 731 mem++;
730 break; 732 break;
731 733
732 case SMALL_TAG_IRQ: 734 case SMALL_TAG_IRQ:
733 if (len < 2 || len > 3) 735 if (len < 2 || len > 3)
734 goto len_err; 736 goto len_err;
735 pnpbios_encode_irq(dev, p, &res->irq_resource[irq]); 737 pnpbios_encode_irq(dev, p,
738 pnp_get_resource(dev, IORESOURCE_IRQ, irq));
736 irq++; 739 irq++;
737 break; 740 break;
738 741
739 case SMALL_TAG_DMA: 742 case SMALL_TAG_DMA:
740 if (len != 2) 743 if (len != 2)
741 goto len_err; 744 goto len_err;
742 pnpbios_encode_dma(dev, p, &res->dma_resource[dma]); 745 pnpbios_encode_dma(dev, p,
746 pnp_get_resource(dev, IORESOURCE_DMA, dma));
743 dma++; 747 dma++;
744 break; 748 break;
745 749
746 case SMALL_TAG_PORT: 750 case SMALL_TAG_PORT:
747 if (len != 7) 751 if (len != 7)
748 goto len_err; 752 goto len_err;
749 pnpbios_encode_port(dev, p, &res->port_resource[port]); 753 pnpbios_encode_port(dev, p,
754 pnp_get_resource(dev, IORESOURCE_IO, port));
750 port++; 755 port++;
751 break; 756 break;
752 757
@@ -757,7 +762,8 @@ static unsigned char *pnpbios_encode_allocated_resource_data(struct pnp_dev
757 case SMALL_TAG_FIXEDPORT: 762 case SMALL_TAG_FIXEDPORT:
758 if (len != 3) 763 if (len != 3)
759 goto len_err; 764 goto len_err;
760 pnpbios_encode_fixed_port(dev, p, &res->port_resource[port]); 765 pnpbios_encode_fixed_port(dev, p,
766 pnp_get_resource(dev, IORESOURCE_IO, port));
761 port++; 767 port++;
762 break; 768 break;
763 769