Merge branches 'acpi-dock', 'acpi-ec' and 'acpi-scan'

* acpi-dock:
  MAINTAINERS: remove maintainship entry of docking station driver

* acpi-ec:
  ACPI / EC: fix NULL pointer dereference in acpi_ec_remove_query_handler()

* acpi-scan:
  ACPI / scan: Add a scan handler for PRP0001
  ACPI / scan: Annotate physical_node_lock in acpi_scan_is_offline()
This commit is contained in:
Rafael J. Wysocki 2015-04-24 02:18:52 +02:00
commit e0155a99b2
3 changed files with 34 additions and 13 deletions

View File

@ -3272,12 +3272,6 @@ F: drivers/firmware/dmi-id.c
F: drivers/firmware/dmi_scan.c F: drivers/firmware/dmi_scan.c
F: include/linux/dmi.h F: include/linux/dmi.h
DOCKING STATION DRIVER
M: Shaohua Li <shaohua.li@intel.com>
L: linux-acpi@vger.kernel.org
S: Supported
F: drivers/acpi/dock.c
DOCUMENTATION DOCUMENTATION
M: Jonathan Corbet <corbet@lwn.net> M: Jonathan Corbet <corbet@lwn.net>
L: linux-doc@vger.kernel.org L: linux-doc@vger.kernel.org

View File

@ -861,7 +861,7 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit)
} }
} }
mutex_unlock(&ec->mutex); mutex_unlock(&ec->mutex);
list_for_each_entry(handler, &free_list, node) list_for_each_entry_safe(handler, tmp, &free_list, node)
acpi_ec_put_query_handler(handler); acpi_ec_put_query_handler(handler);
} }
EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler); EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler);

View File

@ -375,7 +375,11 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent)
struct acpi_device_physical_node *pn; struct acpi_device_physical_node *pn;
bool offline = true; bool offline = true;
mutex_lock(&adev->physical_node_lock); /*
* acpi_container_offline() calls this for all of the container's
* children under the container's physical_node_lock lock.
*/
mutex_lock_nested(&adev->physical_node_lock, SINGLE_DEPTH_NESTING);
list_for_each_entry(pn, &adev->physical_node_list, node) list_for_each_entry(pn, &adev->physical_node_list, node)
if (device_supports_offline(pn->dev) && !pn->dev->offline) { if (device_supports_offline(pn->dev) && !pn->dev->offline) {
@ -2388,9 +2392,6 @@ static void acpi_default_enumeration(struct acpi_device *device)
struct list_head resource_list; struct list_head resource_list;
bool is_spi_i2c_slave = false; bool is_spi_i2c_slave = false;
if (!device->pnp.type.platform_id || device->handler)
return;
/* /*
* Do not enemerate SPI/I2C slaves as they will be enuerated by their * Do not enemerate SPI/I2C slaves as they will be enuerated by their
* respective parents. * respective parents.
@ -2403,6 +2404,29 @@ static void acpi_default_enumeration(struct acpi_device *device)
acpi_create_platform_device(device); acpi_create_platform_device(device);
} }
static const struct acpi_device_id generic_device_ids[] = {
{"PRP0001", },
{"", },
};
static int acpi_generic_device_attach(struct acpi_device *adev,
const struct acpi_device_id *not_used)
{
/*
* Since PRP0001 is the only ID handled here, the test below can be
* unconditional.
*/
if (adev->data.of_compatible)
acpi_default_enumeration(adev);
return 1;
}
static struct acpi_scan_handler generic_device_handler = {
.ids = generic_device_ids,
.attach = acpi_generic_device_attach,
};
static int acpi_scan_attach_handler(struct acpi_device *device) static int acpi_scan_attach_handler(struct acpi_device *device)
{ {
struct acpi_hardware_id *hwid; struct acpi_hardware_id *hwid;
@ -2428,8 +2452,6 @@ static int acpi_scan_attach_handler(struct acpi_device *device)
break; break;
} }
} }
if (!ret)
acpi_default_enumeration(device);
return ret; return ret;
} }
@ -2471,6 +2493,9 @@ static void acpi_bus_attach(struct acpi_device *device)
ret = device_attach(&device->dev); ret = device_attach(&device->dev);
if (ret < 0) if (ret < 0)
return; return;
if (!ret && device->pnp.type.platform_id)
acpi_default_enumeration(device);
} }
device->flags.visited = true; device->flags.visited = true;
@ -2629,6 +2654,8 @@ int __init acpi_scan_init(void)
acpi_pnp_init(); acpi_pnp_init();
acpi_int340x_thermal_init(); acpi_int340x_thermal_init();
acpi_scan_add_handler(&generic_device_handler);
mutex_lock(&acpi_scan_lock); mutex_lock(&acpi_scan_lock);
/* /*
* Enumerate devices in the ACPI namespace. * Enumerate devices in the ACPI namespace.