}
static int acpi_add_single_object(struct acpi_device **child,
- acpi_handle handle, int type,
- unsigned long long sta)
+ acpi_handle handle, int type)
{
struct acpi_device_info *info = NULL;
+ unsigned long long sta = ACPI_STA_DEFAULT;
struct acpi_device *device;
int result;
- if (handle != ACPI_ROOT_OBJECT && type == ACPI_BUS_TYPE_DEVICE)
+ if (type == ACPI_BUS_TYPE_DEVICE && handle != ACPI_ROOT_OBJECT)
acpi_get_object_info(handle, &info);
+ else if (type == ACPI_BUS_TYPE_PROCESSOR &&
+ ACPI_FAILURE(acpi_bus_get_status_handle(handle, &sta)))
+ return -ENODEV;
device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL);
if (!device) {
struct acpi_device **adev_p)
{
struct acpi_device *device = NULL;
- unsigned long long sta = ACPI_STA_DEFAULT;
acpi_object_type acpi_type;
int type;
break;
case ACPI_TYPE_PROCESSOR:
- if (ACPI_FAILURE(acpi_bus_get_status_handle(handle, &sta)))
- return AE_OK;
-
type = ACPI_BUS_TYPE_PROCESSOR;
break;
return AE_OK;
}
- acpi_add_single_object(&device, handle, type, sta);
+ acpi_add_single_object(&device, handle, type);
if (!device)
return AE_CTRL_DEPTH;
struct acpi_device *device = NULL;
int result;
- result = acpi_add_single_object(&device, NULL,
- type, ACPI_STA_DEFAULT);
+ result = acpi_add_single_object(&device, NULL, type);
if (result)
return result;
struct acpi_device *device = NULL;
result = acpi_add_single_object(&device, NULL,
- ACPI_BUS_TYPE_POWER_BUTTON,
- ACPI_STA_DEFAULT);
+ ACPI_BUS_TYPE_POWER_BUTTON);
if (result)
return result;
struct acpi_device *device = NULL;
result = acpi_add_single_object(&device, NULL,
- ACPI_BUS_TYPE_SLEEP_BUTTON,
- ACPI_STA_DEFAULT);
+ ACPI_BUS_TYPE_SLEEP_BUTTON);
if (result)
return result;