mfd: Check for ACPI conflicts
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 19 Feb 2010 10:07:59 +0000 (11:07 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 7 Mar 2010 21:17:21 +0000 (22:17 +0100)
For ACPI based systems, we should check for ACPI conflicts when adding the
platform devices. The test will always succeed for non ACPI platforms.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/mfd-core.c

index ae15e495e20ea86591b7a5bf03d261ecd504d6d7..aa17f4bddc56a1a77fee6f1a641e064f3aed1059 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
+#include <linux/acpi.h>
 #include <linux/mfd/core.h>
 
 static int mfd_add_device(struct device *parent, int id,
@@ -62,6 +63,10 @@ static int mfd_add_device(struct device *parent, int id,
                        res[r].start = cell->resources[r].start;
                        res[r].end   = cell->resources[r].end;
                }
+
+               ret = acpi_check_resource_conflict(res);
+               if (ret)
+                       goto fail_res;
        }
 
        platform_device_add_resources(pdev, res, cell->num_resources);