aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c10
-rw-r--r--drivers/pnp/pnpbios/rsparser.c12
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 4a07cd96f78..bbf3edd85be 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -1020,7 +1020,7 @@ static void pnpacpi_encode_io(struct pnp_dev *dev,
1020 io->minimum = p->start; 1020 io->minimum = p->start;
1021 io->maximum = p->end; 1021 io->maximum = p->end;
1022 io->alignment = 0; /* Correct? */ 1022 io->alignment = 0; /* Correct? */
1023 io->address_length = p->end - p->start + 1; 1023 io->address_length = resource_size(p);
1024 } else { 1024 } else {
1025 io->minimum = 0; 1025 io->minimum = 0;
1026 io->address_length = 0; 1026 io->address_length = 0;
@@ -1038,7 +1038,7 @@ static void pnpacpi_encode_fixed_io(struct pnp_dev *dev,
1038 1038
1039 if (pnp_resource_enabled(p)) { 1039 if (pnp_resource_enabled(p)) {
1040 fixed_io->address = p->start; 1040 fixed_io->address = p->start;
1041 fixed_io->address_length = p->end - p->start + 1; 1041 fixed_io->address_length = resource_size(p);
1042 } else { 1042 } else {
1043 fixed_io->address = 0; 1043 fixed_io->address = 0;
1044 fixed_io->address_length = 0; 1044 fixed_io->address_length = 0;
@@ -1061,7 +1061,7 @@ static void pnpacpi_encode_mem24(struct pnp_dev *dev,
1061 memory24->minimum = p->start; 1061 memory24->minimum = p->start;
1062 memory24->maximum = p->end; 1062 memory24->maximum = p->end;
1063 memory24->alignment = 0; 1063 memory24->alignment = 0;
1064 memory24->address_length = p->end - p->start + 1; 1064 memory24->address_length = resource_size(p);
1065 } else { 1065 } else {
1066 memory24->minimum = 0; 1066 memory24->minimum = 0;
1067 memory24->address_length = 0; 1067 memory24->address_length = 0;
@@ -1085,7 +1085,7 @@ static void pnpacpi_encode_mem32(struct pnp_dev *dev,
1085 memory32->minimum = p->start; 1085 memory32->minimum = p->start;
1086 memory32->maximum = p->end; 1086 memory32->maximum = p->end;
1087 memory32->alignment = 0; 1087 memory32->alignment = 0;
1088 memory32->address_length = p->end - p->start + 1; 1088 memory32->address_length = resource_size(p);
1089 } else { 1089 } else {
1090 memory32->minimum = 0; 1090 memory32->minimum = 0;
1091 memory32->alignment = 0; 1091 memory32->alignment = 0;
@@ -1108,7 +1108,7 @@ static void pnpacpi_encode_fixed_mem32(struct pnp_dev *dev,
1108 p->flags & IORESOURCE_MEM_WRITEABLE ? 1108 p->flags & IORESOURCE_MEM_WRITEABLE ?
1109 ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY; 1109 ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
1110 fixed_memory32->address = p->start; 1110 fixed_memory32->address = p->start;
1111 fixed_memory32->address_length = p->end - p->start + 1; 1111 fixed_memory32->address_length = resource_size(p);
1112 } else { 1112 } else {
1113 fixed_memory32->address = 0; 1113 fixed_memory32->address = 0;
1114 fixed_memory32->address_length = 0; 1114 fixed_memory32->address_length = 0;
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c
index cb1f47bfee9..cca2f9f9f3e 100644
--- a/drivers/pnp/pnpbios/rsparser.c
+++ b/drivers/pnp/pnpbios/rsparser.c
@@ -505,7 +505,7 @@ static void pnpbios_encode_mem(struct pnp_dev *dev, unsigned char *p,
505 505
506 if (pnp_resource_enabled(res)) { 506 if (pnp_resource_enabled(res)) {
507 base = res->start; 507 base = res->start;
508 len = res->end - res->start + 1; 508 len = resource_size(res);
509 } else { 509 } else {
510 base = 0; 510 base = 0;
511 len = 0; 511 len = 0;
@@ -529,7 +529,7 @@ static void pnpbios_encode_mem32(struct pnp_dev *dev, unsigned char *p,
529 529
530 if (pnp_resource_enabled(res)) { 530 if (pnp_resource_enabled(res)) {
531 base = res->start; 531 base = res->start;
532 len = res->end - res->start + 1; 532 len = resource_size(res);
533 } else { 533 } else {
534 base = 0; 534 base = 0;
535 len = 0; 535 len = 0;
@@ -559,7 +559,7 @@ static void pnpbios_encode_fixed_mem32(struct pnp_dev *dev, unsigned char *p,
559 559
560 if (pnp_resource_enabled(res)) { 560 if (pnp_resource_enabled(res)) {
561 base = res->start; 561 base = res->start;
562 len = res->end - res->start + 1; 562 len = resource_size(res);
563 } else { 563 } else {
564 base = 0; 564 base = 0;
565 len = 0; 565 len = 0;
@@ -617,7 +617,7 @@ static void pnpbios_encode_port(struct pnp_dev *dev, unsigned char *p,
617 617
618 if (pnp_resource_enabled(res)) { 618 if (pnp_resource_enabled(res)) {
619 base = res->start; 619 base = res->start;
620 len = res->end - res->start + 1; 620 len = resource_size(res);
621 } else { 621 } else {
622 base = 0; 622 base = 0;
623 len = 0; 623 len = 0;
@@ -636,11 +636,11 @@ static void pnpbios_encode_fixed_port(struct pnp_dev *dev, unsigned char *p,
636 struct resource *res) 636 struct resource *res)
637{ 637{
638 unsigned long base = res->start; 638 unsigned long base = res->start;
639 unsigned long len = res->end - res->start + 1; 639 unsigned long len = resource_size(res);
640 640
641 if (pnp_resource_enabled(res)) { 641 if (pnp_resource_enabled(res)) {
642 base = res->start; 642 base = res->start;
643 len = res->end - res->start + 1; 643 len = resource_size(res);
644 } else { 644 } else {
645 base = 0; 645 base = 0;
646 len = 0; 646 len = 0;