From: Thomas Gleixner Date: Mon, 2 Feb 2015 02:42:50 +0000 (+0800) Subject: ACPI: Let the parser return false for disabled resources X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e814f6deee6188265b5af9f1190e5734f116860e;p=linux-beck.git 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 Signed-off-by: Jiang Liu Signed-off-by: Rafael J. Wysocki --- 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);