Merge branch 'acpi-cleanup'
* acpi-cleanup: (21 commits) ACPI / dock: fix error return code in dock_add() ACPI / dock: Drop unnecessary local variable from dock_add() ACPI / dock / PCI: Drop ACPI dock notifier chain ACPI / dock: Do not check CONFIG_ACPI_DOCK_MODULE ACPI / dock: Do not leak memory on falilures to add a dock station ACPI: Drop ACPI bus notifier call chain ACPI / dock: Rework the handling of notifications ACPI / dock: Simplify dock_init_hotplug() and dock_release_hotplug() ACPI / dock: Walk list in reverse order during removal of devices ACPI / dock: Rework and simplify find_dock_devices() ACPI / dock: Drop the hp_lock mutex from struct dock_station ACPI: simplify acpiphp driver with new helper functions ACPI: simplify dock driver with new helper functions ACPI: Export acpi_(bay)|(dock)_match() from scan.c ACPI: introduce two helper functions for _EJ0 and _LCK ACPI: introduce helper function acpi_execute_simple_method() ACPI: introduce helper function acpi_has_method() ACPI / dock: simplify dock_create_acpi_device() ACPI / dock: mark initialization functions with __init ACPI / dock: drop redundant spin lock in dock station object ...
This commit is contained in:
@@ -355,14 +355,10 @@ static int
|
||||
acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
|
||||
{
|
||||
int status;
|
||||
union acpi_object arg0 = { ACPI_TYPE_INTEGER };
|
||||
struct acpi_object_list args = { 1, &arg0 };
|
||||
int state;
|
||||
|
||||
arg0.integer.value = level;
|
||||
|
||||
status = acpi_evaluate_object(device->dev->handle, "_BCM",
|
||||
&args, NULL);
|
||||
status = acpi_execute_simple_method(device->dev->handle,
|
||||
"_BCM", level);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_ERROR((AE_INFO, "Evaluating _BCM failed"));
|
||||
return -EIO;
|
||||
@@ -638,18 +634,15 @@ static int
|
||||
acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
|
||||
{
|
||||
acpi_status status;
|
||||
union acpi_object arg0 = { ACPI_TYPE_INTEGER };
|
||||
struct acpi_object_list args = { 1, &arg0 };
|
||||
|
||||
if (!video->cap._DOS)
|
||||
return 0;
|
||||
|
||||
if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1)
|
||||
return -EINVAL;
|
||||
arg0.integer.value = (lcd_flag << 2) | bios_flag;
|
||||
video->dos_setting = arg0.integer.value;
|
||||
status = acpi_evaluate_object(video->device->handle, "_DOS",
|
||||
&args, NULL);
|
||||
video->dos_setting = (lcd_flag << 2) | bios_flag;
|
||||
status = acpi_execute_simple_method(video->device->handle, "_DOS",
|
||||
(lcd_flag << 2) | bios_flag);
|
||||
if (ACPI_FAILURE(status))
|
||||
return -EIO;
|
||||
|
||||
@@ -885,28 +878,21 @@ out:
|
||||
|
||||
static void acpi_video_device_find_cap(struct acpi_video_device *device)
|
||||
{
|
||||
acpi_handle h_dummy1;
|
||||
|
||||
if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) {
|
||||
if (acpi_has_method(device->dev->handle, "_ADR"))
|
||||
device->cap._ADR = 1;
|
||||
}
|
||||
if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCL", &h_dummy1))) {
|
||||
if (acpi_has_method(device->dev->handle, "_BCL"))
|
||||
device->cap._BCL = 1;
|
||||
}
|
||||
if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCM", &h_dummy1))) {
|
||||
if (acpi_has_method(device->dev->handle, "_BCM"))
|
||||
device->cap._BCM = 1;
|
||||
}
|
||||
if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle,"_BQC",&h_dummy1)))
|
||||
if (acpi_has_method(device->dev->handle, "_BQC")) {
|
||||
device->cap._BQC = 1;
|
||||
else if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCQ",
|
||||
&h_dummy1))) {
|
||||
} else if (acpi_has_method(device->dev->handle, "_BCQ")) {
|
||||
printk(KERN_WARNING FW_BUG "_BCQ is used instead of _BQC\n");
|
||||
device->cap._BCQ = 1;
|
||||
}
|
||||
|
||||
if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DDC", &h_dummy1))) {
|
||||
if (acpi_has_method(device->dev->handle, "_DDC"))
|
||||
device->cap._DDC = 1;
|
||||
}
|
||||
|
||||
if (acpi_video_backlight_support()) {
|
||||
struct backlight_properties props;
|
||||
@@ -994,26 +980,18 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
|
||||
|
||||
static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
|
||||
{
|
||||
acpi_handle h_dummy1;
|
||||
|
||||
if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) {
|
||||
if (acpi_has_method(video->device->handle, "_DOS"))
|
||||
video->cap._DOS = 1;
|
||||
}
|
||||
if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOD", &h_dummy1))) {
|
||||
if (acpi_has_method(video->device->handle, "_DOD"))
|
||||
video->cap._DOD = 1;
|
||||
}
|
||||
if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_ROM", &h_dummy1))) {
|
||||
if (acpi_has_method(video->device->handle, "_ROM"))
|
||||
video->cap._ROM = 1;
|
||||
}
|
||||
if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_GPD", &h_dummy1))) {
|
||||
if (acpi_has_method(video->device->handle, "_GPD"))
|
||||
video->cap._GPD = 1;
|
||||
}
|
||||
if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_SPD", &h_dummy1))) {
|
||||
if (acpi_has_method(video->device->handle, "_SPD"))
|
||||
video->cap._SPD = 1;
|
||||
}
|
||||
if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_VPO", &h_dummy1))) {
|
||||
if (acpi_has_method(video->device->handle, "_VPO"))
|
||||
video->cap._VPO = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user