]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
ACPI / scan: Do not bind ACPI drivers to objects with scan handlers
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 15 Jun 2013 22:36:41 +0000 (00:36 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 19 Jun 2013 23:25:19 +0000 (01:25 +0200)
ACPI drivers must not be bound to device objects having scan handlers
attatched to them, so make acpi_device_probe() fail with -EINVAL if the
device object being probed has an ACPI scan handler.

After this change the analogous check introduced into the ACPI video
driver by commit 8c9b7a7 (ACPI / video: Do not bind to device objects
with a scan handler) is not necessary any more and may be dropped, so
drop it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Tony Luck <tony.luck@gmail.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
drivers/acpi/scan.c
drivers/acpi/video.c

index 4eeea226245412e5ddfa1c147ea41440bf39ca9a..54529424a0a5f05f2c054691a73f62090537cab8 100644 (file)
@@ -822,6 +822,9 @@ static int acpi_device_probe(struct device *dev)
        struct acpi_driver *acpi_drv = to_acpi_driver(dev->driver);
        int ret;
 
+       if (acpi_dev->handler)
+               return -EINVAL;
+
        if (!acpi_drv->ops.add)
                return -ENOSYS;
 
index 440eadf2d32cdd270a75e9023f9ef31a1d9ae794..5d7075d25700b3bbd2cbe65772391155d1a10d30 100644 (file)
@@ -1722,9 +1722,6 @@ static int acpi_video_bus_add(struct acpi_device *device)
        int error;
        acpi_status status;
 
-       if (device->handler)
-               return -EINVAL;
-
        status = acpi_walk_namespace(ACPI_TYPE_DEVICE,
                                device->parent->handle, 1,
                                acpi_video_bus_match, NULL,