diff options
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r-- | drivers/acpi/battery.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 082b4dd252a8..a7627166e18b 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -548,12 +548,8 @@ static int acpi_battery_set_alarm(struct acpi_battery *battery) | |||
548 | 548 | ||
549 | static int acpi_battery_init_alarm(struct acpi_battery *battery) | 549 | static int acpi_battery_init_alarm(struct acpi_battery *battery) |
550 | { | 550 | { |
551 | acpi_status status = AE_OK; | ||
552 | acpi_handle handle = NULL; | ||
553 | |||
554 | /* See if alarms are supported, and if so, set default */ | 551 | /* See if alarms are supported, and if so, set default */ |
555 | status = acpi_get_handle(battery->device->handle, "_BTP", &handle); | 552 | if (!acpi_has_method(battery->device->handle, "_BTP")) { |
556 | if (ACPI_FAILURE(status)) { | ||
557 | clear_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags); | 553 | clear_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags); |
558 | return 0; | 554 | return 0; |
559 | } | 555 | } |
@@ -1066,7 +1062,7 @@ static int acpi_battery_add(struct acpi_device *device) | |||
1066 | { | 1062 | { |
1067 | int result = 0; | 1063 | int result = 0; |
1068 | struct acpi_battery *battery = NULL; | 1064 | struct acpi_battery *battery = NULL; |
1069 | acpi_handle handle; | 1065 | |
1070 | if (!device) | 1066 | if (!device) |
1071 | return -EINVAL; | 1067 | return -EINVAL; |
1072 | battery = kzalloc(sizeof(struct acpi_battery), GFP_KERNEL); | 1068 | battery = kzalloc(sizeof(struct acpi_battery), GFP_KERNEL); |
@@ -1078,8 +1074,7 @@ static int acpi_battery_add(struct acpi_device *device) | |||
1078 | device->driver_data = battery; | 1074 | device->driver_data = battery; |
1079 | mutex_init(&battery->lock); | 1075 | mutex_init(&battery->lock); |
1080 | mutex_init(&battery->sysfs_lock); | 1076 | mutex_init(&battery->sysfs_lock); |
1081 | if (ACPI_SUCCESS(acpi_get_handle(battery->device->handle, | 1077 | if (acpi_has_method(battery->device->handle, "_BIX")) |
1082 | "_BIX", &handle))) | ||
1083 | set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags); | 1078 | set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags); |
1084 | result = acpi_battery_update(battery); | 1079 | result = acpi_battery_update(battery); |
1085 | if (result) | 1080 | if (result) |