]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI / platform: Use struct acpi_scan_handler for creating devices
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 30 Jan 2013 13:27:40 +0000 (14:27 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 30 Jan 2013 13:27:40 +0000 (14:27 +0100)
commit5ccaa9047f96bfe14aa1900738d36e2ec03d90f7
treef89584c92cf7593fe8f52b28f2f80c97aa590721
parent8bca30c9b8e0f47ed092b873904b3308ff100f7e
ACPI / platform: Use struct acpi_scan_handler for creating devices

Currently, the ACPI namespace scanning code creates platform device
objects for ACPI device nodes whose IDs match the contents of the
acpi_platform_device_ids[] table.  However, this adds a superfluous
special case into acpi_bus_device_attach() and makes it more
difficult to follow than it has to be.  It also will make it more
difficult to implement removal code for those platform device objects
in the future.

For the above reasons, introduce a struct acpi_scan_handler object
for creating platform devices and move the code related to that from
acpi_bus_device_attach() to the .attach() callback of that object.
Also move the acpi_platform_device_ids[] table to acpi_platform.c.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/acpi/acpi_platform.c
drivers/acpi/internal.h
drivers/acpi/scan.c