diff options
author | Ryan Kennedy <ryan5544@gmail.com> | 2017-07-15 17:48:18 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-07-26 02:09:41 +0200 |
commit | 31e86cb99a3af0653f0e317fdd9c05b530c70af8 (patch) | |
tree | 2ddfc48c0d39f46a6618d6f5108000a265bfa633 /drivers/acpi | |
parent | 520eccdfe187591a51ea9ab4c1a024ae4d0f68d9 (diff) |
ACPI / watchdog: Fix init failure with overlapping register regions
Partially overlapping regions cause platform device creation
to fail. The latter of two overlapping resources will fail to be
reserved. Fix this by merging overlapping resource ranges while
enumerating WDAT table entries.
Signed-off-by: Ryan Kennedy <ryan5544@gmail.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpi_watchdog.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_watchdog.c b/drivers/acpi/acpi_watchdog.c index 8c4e0a18460a..bf22c29d2517 100644 --- a/drivers/acpi/acpi_watchdog.c +++ b/drivers/acpi/acpi_watchdog.c @@ -86,7 +86,12 @@ void __init acpi_watchdog_init(void) found = false; resource_list_for_each_entry(rentry, &resource_list) { - if (resource_contains(rentry->res, &res)) { + if (rentry->res->flags == res.flags && + resource_overlaps(rentry->res, &res)) { + if (res.start < rentry->res->start) + rentry->res->start = res.start; + if (res.end > rentry->res->end) + rentry->res->end = res.end; found = true; break; } |