@@ -323,8 +323,10 @@ acpi_video_device_lcd_query_levels(acpi_handle handle,
*levels = NULL;
status = acpi_evaluate_object(handle, "_BCL", NULL, &buffer);
- if (!ACPI_SUCCESS(status))
+ if (!ACPI_SUCCESS(status)) {
+ pr_err("acpi_evaluate_BCL failed, %d\n", status);
return status;
+ }
obj = (union acpi_object *)buffer.pointer;
if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
printk(KERN_ERR PREFIX "Invalid _BCL data\n");
@@ -765,13 +767,13 @@ int acpi_video_get_levels(struct acpi_device *device,
if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device->handle,
&obj))) {
- ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not query available "
- "LCD brightness level\n"));
+ pr_err("Could not query available LCD brightness level\n");
result = -ENODEV;
goto out;
}
if (obj->package.count < 2) {
+ pr_err("_BCL count smaller than 2, %d\n", obj->package.count);
result = -EINVAL;
goto out;
}
@@ -786,6 +788,7 @@ int acpi_video_get_levels(struct acpi_device *device,
br->levels = kmalloc((obj->package.count + 2) * sizeof *(br->levels),
GFP_KERNEL);
if (!br->levels) {
+ pr_err("kmalloc for br->levels failed\n");
result = -ENOMEM;
goto out_free;
}
@@ -870,8 +873,10 @@ acpi_video_init_brightness(struct acpi_video_device *device)
int result = -EINVAL;
result = acpi_video_get_levels(device->dev, &br);
- if (result)
+ if (result) {
+ pr_err("acpi_video_get_levels failed, %d\n", result);
return result;
+ }
device->brightness = br;
/* _BQC uses INDEX while _BCL uses VALUE in some laptops */
@@ -882,12 +887,16 @@ acpi_video_init_brightness(struct acpi_video_device *device)
result = acpi_video_device_lcd_get_level_current(device,
&level_old, true);
- if (result)
+ if (result) {
+ pr_err("acpi_video_device_lcd_get_level_current failed, %d\n", result);
goto out_free_levels;
+ }
result = acpi_video_bqc_quirk(device, max_level, level_old);
- if (result)
+ if (result) {
+ pr_err("acpi_video_bqc_quirk failed, %d\n", result);
goto out_free_levels;
+ }
/*
* cap._BQC may get cleared due to _BQC is found to be broken
* in acpi_video_bqc_quirk, so check again here.
@@ -910,11 +919,12 @@ acpi_video_init_brightness(struct acpi_video_device *device)
set_level:
result = acpi_video_device_lcd_set_level(device, level);
- if (result)
+ if (result) {
+ pr_err("acpi_video_device_lcd_set_level failed, %d\n", result);
goto out_free_levels;
+ }
- ACPI_DEBUG_PRINT((ACPI_DB_INFO,
- "found %d brightness levels\n", br->count - 2));
+ pr_info("found %d brightness levels\n", br->count - 2);
return 0;
out_free_levels: