aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 4139e65d0ff5..5049230ccf49 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1027,12 +1027,11 @@ acpi_add_single_object(struct acpi_device **child,
1027 if (!child) 1027 if (!child)
1028 return -EINVAL; 1028 return -EINVAL;
1029 1029
1030 device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL); 1030 device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL);
1031 if (!device) { 1031 if (!device) {
1032 printk(KERN_ERR PREFIX "Memory allocation error\n"); 1032 printk(KERN_ERR PREFIX "Memory allocation error\n");
1033 return -ENOMEM; 1033 return -ENOMEM;
1034 } 1034 }
1035 memset(device, 0, sizeof(struct acpi_device));
1036 1035
1037 device->handle = handle; 1036 device->handle = handle;
1038 device->parent = parent; 1037 device->parent = parent;
@@ -1368,14 +1367,14 @@ static int acpi_bus_scan_fixed(struct acpi_device *root)
1368 /* 1367 /*
1369 * Enumerate all fixed-feature devices. 1368 * Enumerate all fixed-feature devices.
1370 */ 1369 */
1371 if (acpi_fadt.pwr_button == 0) { 1370 if ((acpi_gbl_FADT.flags & ACPI_FADT_POWER_BUTTON) == 0) {
1372 result = acpi_add_single_object(&device, acpi_root, 1371 result = acpi_add_single_object(&device, acpi_root,
1373 NULL, 1372 NULL,
1374 ACPI_BUS_TYPE_POWER_BUTTON, 1373 ACPI_BUS_TYPE_POWER_BUTTON,
1375 &ops); 1374 &ops);
1376 } 1375 }
1377 1376
1378 if (acpi_fadt.sleep_button == 0) { 1377 if ((acpi_gbl_FADT.flags & ACPI_FADT_SLEEP_BUTTON) == 0) {
1379 result = acpi_add_single_object(&device, acpi_root, 1378 result = acpi_add_single_object(&device, acpi_root,
1380 NULL, 1379 NULL,
1381 ACPI_BUS_TYPE_SLEEP_BUTTON, 1380 ACPI_BUS_TYPE_SLEEP_BUTTON,