diff options
Diffstat (limited to 'drivers/pnp/pnpacpi/rsparser.c')
-rw-r--r-- | drivers/pnp/pnpacpi/rsparser.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 95015cbfd33f..adf17856bacc 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -132,7 +132,8 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_dev *dev, | |||
132 | pnp_add_irq_resource(dev, irq, flags); | 132 | pnp_add_irq_resource(dev, irq, flags); |
133 | } | 133 | } |
134 | 134 | ||
135 | static int dma_flags(int type, int bus_master, int transfer) | 135 | static int dma_flags(struct pnp_dev *dev, int type, int bus_master, |
136 | int transfer) | ||
136 | { | 137 | { |
137 | int flags = 0; | 138 | int flags = 0; |
138 | 139 | ||
@@ -154,7 +155,7 @@ static int dma_flags(int type, int bus_master, int transfer) | |||
154 | default: | 155 | default: |
155 | /* Set a default value ? */ | 156 | /* Set a default value ? */ |
156 | flags |= IORESOURCE_DMA_COMPATIBLE; | 157 | flags |= IORESOURCE_DMA_COMPATIBLE; |
157 | pnp_err("Invalid DMA type"); | 158 | dev_err(&dev->dev, "invalid DMA type %d\n", type); |
158 | } | 159 | } |
159 | switch (transfer) { | 160 | switch (transfer) { |
160 | case ACPI_TRANSFER_8: | 161 | case ACPI_TRANSFER_8: |
@@ -169,7 +170,7 @@ static int dma_flags(int type, int bus_master, int transfer) | |||
169 | default: | 170 | default: |
170 | /* Set a default value ? */ | 171 | /* Set a default value ? */ |
171 | flags |= IORESOURCE_DMA_8AND16BIT; | 172 | flags |= IORESOURCE_DMA_8AND16BIT; |
172 | pnp_err("Invalid DMA transfer type"); | 173 | dev_err(&dev->dev, "invalid DMA transfer type %d\n", transfer); |
173 | } | 174 | } |
174 | 175 | ||
175 | return flags; | 176 | return flags; |
@@ -336,7 +337,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, | |||
336 | case ACPI_RESOURCE_TYPE_DMA: | 337 | case ACPI_RESOURCE_TYPE_DMA: |
337 | dma = &res->data.dma; | 338 | dma = &res->data.dma; |
338 | if (dma->channel_count > 0 && dma->channels[0] != (u8) -1) | 339 | if (dma->channel_count > 0 && dma->channels[0] != (u8) -1) |
339 | flags = dma_flags(dma->type, dma->bus_master, | 340 | flags = dma_flags(dev, dma->type, dma->bus_master, |
340 | dma->transfer); | 341 | dma->transfer); |
341 | else | 342 | else |
342 | flags = IORESOURCE_DISABLED; | 343 | flags = IORESOURCE_DISABLED; |
@@ -449,7 +450,7 @@ int pnpacpi_parse_allocated_resource(struct pnp_dev *dev) | |||
449 | acpi_handle handle = dev->data; | 450 | acpi_handle handle = dev->data; |
450 | acpi_status status; | 451 | acpi_status status; |
451 | 452 | ||
452 | dev_dbg(&dev->dev, "parse allocated resources\n"); | 453 | pnp_dbg(&dev->dev, "parse allocated resources\n"); |
453 | 454 | ||
454 | pnp_init_resources(dev); | 455 | pnp_init_resources(dev); |
455 | 456 | ||
@@ -477,7 +478,7 @@ static __init void pnpacpi_parse_dma_option(struct pnp_dev *dev, | |||
477 | for (i = 0; i < p->channel_count; i++) | 478 | for (i = 0; i < p->channel_count; i++) |
478 | map |= 1 << p->channels[i]; | 479 | map |= 1 << p->channels[i]; |
479 | 480 | ||
480 | flags = dma_flags(p->type, p->bus_master, p->transfer); | 481 | flags = dma_flags(dev, p->type, p->bus_master, p->transfer); |
481 | pnp_register_dma_resource(dev, option_flags, map, flags); | 482 | pnp_register_dma_resource(dev, option_flags, map, flags); |
482 | } | 483 | } |
483 | 484 | ||
@@ -608,8 +609,8 @@ static __init void pnpacpi_parse_address_option(struct pnp_dev *dev, | |||
608 | unsigned char flags = 0; | 609 | unsigned char flags = 0; |
609 | 610 | ||
610 | status = acpi_resource_to_address64(r, p); | 611 | status = acpi_resource_to_address64(r, p); |
611 | if (!ACPI_SUCCESS(status)) { | 612 | if (ACPI_FAILURE(status)) { |
612 | pnp_warn("PnPACPI: failed to convert resource type %d", | 613 | dev_warn(&dev->dev, "can't convert resource type %d\n", |
613 | r->type); | 614 | r->type); |
614 | return; | 615 | return; |
615 | } | 616 | } |
@@ -735,7 +736,7 @@ int __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev) | |||
735 | acpi_status status; | 736 | acpi_status status; |
736 | struct acpipnp_parse_option_s parse_data; | 737 | struct acpipnp_parse_option_s parse_data; |
737 | 738 | ||
738 | dev_dbg(&dev->dev, "parse resource options\n"); | 739 | pnp_dbg(&dev->dev, "parse resource options\n"); |
739 | 740 | ||
740 | parse_data.dev = dev; | 741 | parse_data.dev = dev; |
741 | parse_data.option_flags = 0; | 742 | parse_data.option_flags = 0; |
@@ -843,7 +844,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev, | |||
843 | 844 | ||
844 | if (!pnp_resource_enabled(p)) { | 845 | if (!pnp_resource_enabled(p)) { |
845 | irq->interrupt_count = 0; | 846 | irq->interrupt_count = 0; |
846 | dev_dbg(&dev->dev, " encode irq (%s)\n", | 847 | pnp_dbg(&dev->dev, " encode irq (%s)\n", |
847 | p ? "disabled" : "missing"); | 848 | p ? "disabled" : "missing"); |
848 | return; | 849 | return; |
849 | } | 850 | } |
@@ -855,7 +856,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev, | |||
855 | irq->interrupt_count = 1; | 856 | irq->interrupt_count = 1; |
856 | irq->interrupts[0] = p->start; | 857 | irq->interrupts[0] = p->start; |
857 | 858 | ||
858 | dev_dbg(&dev->dev, " encode irq %d %s %s %s (%d-byte descriptor)\n", | 859 | pnp_dbg(&dev->dev, " encode irq %d %s %s %s (%d-byte descriptor)\n", |
859 | (int) p->start, | 860 | (int) p->start, |
860 | triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", | 861 | triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", |
861 | polarity == ACPI_ACTIVE_LOW ? "low" : "high", | 862 | polarity == ACPI_ACTIVE_LOW ? "low" : "high", |
@@ -872,7 +873,7 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev, | |||
872 | 873 | ||
873 | if (!pnp_resource_enabled(p)) { | 874 | if (!pnp_resource_enabled(p)) { |
874 | extended_irq->interrupt_count = 0; | 875 | extended_irq->interrupt_count = 0; |
875 | dev_dbg(&dev->dev, " encode extended irq (%s)\n", | 876 | pnp_dbg(&dev->dev, " encode extended irq (%s)\n", |
876 | p ? "disabled" : "missing"); | 877 | p ? "disabled" : "missing"); |
877 | return; | 878 | return; |
878 | } | 879 | } |
@@ -885,7 +886,7 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev, | |||
885 | extended_irq->interrupt_count = 1; | 886 | extended_irq->interrupt_count = 1; |
886 | extended_irq->interrupts[0] = p->start; | 887 | extended_irq->interrupts[0] = p->start; |
887 | 888 | ||
888 | dev_dbg(&dev->dev, " encode irq %d %s %s %s\n", (int) p->start, | 889 | pnp_dbg(&dev->dev, " encode irq %d %s %s %s\n", (int) p->start, |
889 | triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", | 890 | triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", |
890 | polarity == ACPI_ACTIVE_LOW ? "low" : "high", | 891 | polarity == ACPI_ACTIVE_LOW ? "low" : "high", |
891 | extended_irq->sharable == ACPI_SHARED ? "shared" : "exclusive"); | 892 | extended_irq->sharable == ACPI_SHARED ? "shared" : "exclusive"); |
@@ -899,7 +900,7 @@ static void pnpacpi_encode_dma(struct pnp_dev *dev, | |||
899 | 900 | ||
900 | if (!pnp_resource_enabled(p)) { | 901 | if (!pnp_resource_enabled(p)) { |
901 | dma->channel_count = 0; | 902 | dma->channel_count = 0; |
902 | dev_dbg(&dev->dev, " encode dma (%s)\n", | 903 | pnp_dbg(&dev->dev, " encode dma (%s)\n", |
903 | p ? "disabled" : "missing"); | 904 | p ? "disabled" : "missing"); |
904 | return; | 905 | return; |
905 | } | 906 | } |
@@ -934,7 +935,7 @@ static void pnpacpi_encode_dma(struct pnp_dev *dev, | |||
934 | dma->channel_count = 1; | 935 | dma->channel_count = 1; |
935 | dma->channels[0] = p->start; | 936 | dma->channels[0] = p->start; |
936 | 937 | ||
937 | dev_dbg(&dev->dev, " encode dma %d " | 938 | pnp_dbg(&dev->dev, " encode dma %d " |
938 | "type %#x transfer %#x master %d\n", | 939 | "type %#x transfer %#x master %d\n", |
939 | (int) p->start, dma->type, dma->transfer, dma->bus_master); | 940 | (int) p->start, dma->type, dma->transfer, dma->bus_master); |
940 | } | 941 | } |
@@ -958,7 +959,7 @@ static void pnpacpi_encode_io(struct pnp_dev *dev, | |||
958 | io->address_length = 0; | 959 | io->address_length = 0; |
959 | } | 960 | } |
960 | 961 | ||
961 | dev_dbg(&dev->dev, " encode io %#x-%#x decode %#x\n", io->minimum, | 962 | pnp_dbg(&dev->dev, " encode io %#x-%#x decode %#x\n", io->minimum, |
962 | io->minimum + io->address_length - 1, io->io_decode); | 963 | io->minimum + io->address_length - 1, io->io_decode); |
963 | } | 964 | } |
964 | 965 | ||
@@ -976,7 +977,7 @@ static void pnpacpi_encode_fixed_io(struct pnp_dev *dev, | |||
976 | fixed_io->address_length = 0; | 977 | fixed_io->address_length = 0; |
977 | } | 978 | } |
978 | 979 | ||
979 | dev_dbg(&dev->dev, " encode fixed_io %#x-%#x\n", fixed_io->address, | 980 | pnp_dbg(&dev->dev, " encode fixed_io %#x-%#x\n", fixed_io->address, |
980 | fixed_io->address + fixed_io->address_length - 1); | 981 | fixed_io->address + fixed_io->address_length - 1); |
981 | } | 982 | } |
982 | 983 | ||
@@ -999,7 +1000,7 @@ static void pnpacpi_encode_mem24(struct pnp_dev *dev, | |||
999 | memory24->address_length = 0; | 1000 | memory24->address_length = 0; |
1000 | } | 1001 | } |
1001 | 1002 | ||
1002 | dev_dbg(&dev->dev, " encode mem24 %#x-%#x write_protect %#x\n", | 1003 | pnp_dbg(&dev->dev, " encode mem24 %#x-%#x write_protect %#x\n", |
1003 | memory24->minimum, | 1004 | memory24->minimum, |
1004 | memory24->minimum + memory24->address_length - 1, | 1005 | memory24->minimum + memory24->address_length - 1, |
1005 | memory24->write_protect); | 1006 | memory24->write_protect); |
@@ -1023,7 +1024,7 @@ static void pnpacpi_encode_mem32(struct pnp_dev *dev, | |||
1023 | memory32->alignment = 0; | 1024 | memory32->alignment = 0; |
1024 | } | 1025 | } |
1025 | 1026 | ||
1026 | dev_dbg(&dev->dev, " encode mem32 %#x-%#x write_protect %#x\n", | 1027 | pnp_dbg(&dev->dev, " encode mem32 %#x-%#x write_protect %#x\n", |
1027 | memory32->minimum, | 1028 | memory32->minimum, |
1028 | memory32->minimum + memory32->address_length - 1, | 1029 | memory32->minimum + memory32->address_length - 1, |
1029 | memory32->write_protect); | 1030 | memory32->write_protect); |
@@ -1046,7 +1047,7 @@ static void pnpacpi_encode_fixed_mem32(struct pnp_dev *dev, | |||
1046 | fixed_memory32->address_length = 0; | 1047 | fixed_memory32->address_length = 0; |
1047 | } | 1048 | } |
1048 | 1049 | ||
1049 | dev_dbg(&dev->dev, " encode fixed_mem32 %#x-%#x write_protect %#x\n", | 1050 | pnp_dbg(&dev->dev, " encode fixed_mem32 %#x-%#x write_protect %#x\n", |
1050 | fixed_memory32->address, | 1051 | fixed_memory32->address, |
1051 | fixed_memory32->address + fixed_memory32->address_length - 1, | 1052 | fixed_memory32->address + fixed_memory32->address_length - 1, |
1052 | fixed_memory32->write_protect); | 1053 | fixed_memory32->write_protect); |
@@ -1060,7 +1061,7 @@ int pnpacpi_encode_resources(struct pnp_dev *dev, struct acpi_buffer *buffer) | |||
1060 | struct acpi_resource *resource = buffer->pointer; | 1061 | struct acpi_resource *resource = buffer->pointer; |
1061 | int port = 0, irq = 0, dma = 0, mem = 0; | 1062 | int port = 0, irq = 0, dma = 0, mem = 0; |
1062 | 1063 | ||
1063 | dev_dbg(&dev->dev, "encode %d resources\n", res_cnt); | 1064 | pnp_dbg(&dev->dev, "encode %d resources\n", res_cnt); |
1064 | while (i < res_cnt) { | 1065 | while (i < res_cnt) { |
1065 | switch (resource->type) { | 1066 | switch (resource->type) { |
1066 | case ACPI_RESOURCE_TYPE_IRQ: | 1067 | case ACPI_RESOURCE_TYPE_IRQ: |