summaryrefslogtreecommitdiff
path: root/drivers/acpi/resource.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-02-02 05:42:50 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-02-04 00:27:18 +0300
commite814f6deee6188265b5af9f1190e5734f116860e (patch)
tree6394ece5bd4e3452050808fa14b840ff451ed850 /drivers/acpi/resource.c
parent1d0420f1cfc4763a8c5bfc617e0a40f710c2f74d (diff)
downloadlinux-e814f6deee6188265b5af9f1190e5734f116860e.tar.xz
ACPI: Let the parser return false for disabled resources
If the parser disables a resource during parsing, let it return false, so the calling code does not need to implement further checks. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/resource.c')
-rw-r--r--drivers/acpi/resource.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 16d291c60277..cdb1a3c4a0b9 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -219,10 +219,10 @@ bool acpi_dev_resource_address_space(struct acpi_resource *ares,
res->flags = IORESOURCE_BUS;
break;
default:
- res->flags = 0;
+ return false;
}
- return true;
+ return !(res->flags & IORESOURCE_DISABLED);
}
EXPORT_SYMBOL_GPL(acpi_dev_resource_address_space);
@@ -268,10 +268,10 @@ bool acpi_dev_resource_ext_address_space(struct acpi_resource *ares,
res->flags = IORESOURCE_BUS;
break;
default:
- res->flags = 0;
+ return false;
}
- return true;
+ return !(res->flags & IORESOURCE_DISABLED);
}
EXPORT_SYMBOL_GPL(acpi_dev_resource_ext_address_space);