Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188097
b: refs/heads/master
c: 70287db
h: refs/heads/master
i:
  188095: 5471ef9
v: v3
  • Loading branch information
Matthew Garrett authored and Len Brown committed Mar 14, 2010
1 parent ae90946 commit 3d3329e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b7ef6d8f16274da42344cd50746ddb1c93c25ea
refs/heads/master: 70287db87cfc968fe78bf82a489833cc77b84352
18 changes: 1 addition & 17 deletions trunk/drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,23 +575,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)

static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
{
int i, valid, ret = acpi_thermal_trips_update(tz, ACPI_TRIPS_INIT);

if (ret)
return ret;

valid = tz->trips.critical.flags.valid |
tz->trips.hot.flags.valid |
tz->trips.passive.flags.valid;

for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++)
valid |= tz->trips.active[i].flags.valid;

if (!valid) {
printk(KERN_WARNING FW_BUG "No valid trip found\n");
return -ENODEV;
}
return 0;
return acpi_thermal_trips_update(tz, ACPI_TRIPS_INIT);
}

static void acpi_thermal_check(void *data)
Expand Down
28 changes: 17 additions & 11 deletions trunk/drivers/acpi/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ static int acpi_video_device_lcd_set_level(struct acpi_video_device *device,
int level);
static int acpi_video_device_lcd_get_level_current(
struct acpi_video_device *device,
unsigned long long *level);
unsigned long long *level, int init);
static int acpi_video_get_next_level(struct acpi_video_device *device,
u32 level_current, u32 event);
static int acpi_video_switch_brightness(struct acpi_video_device *device,
Expand All @@ -345,7 +345,7 @@ static int acpi_video_get_brightness(struct backlight_device *bd)
struct acpi_video_device *vd =
(struct acpi_video_device *)bl_get_data(bd);

if (acpi_video_device_lcd_get_level_current(vd, &cur_level))
if (acpi_video_device_lcd_get_level_current(vd, &cur_level, 0))
return -EINVAL;
for (i = 2; i < vd->brightness->count; i++) {
if (vd->brightness->levels[i] == cur_level)
Expand Down Expand Up @@ -414,7 +414,7 @@ static int video_get_cur_state(struct thermal_cooling_device *cooling_dev, unsig
unsigned long long level;
int offset;

if (acpi_video_device_lcd_get_level_current(video, &level))
if (acpi_video_device_lcd_get_level_current(video, &level, 0))
return -EINVAL;
for (offset = 2; offset < video->brightness->count; offset++)
if (level == video->brightness->levels[offset]) {
Expand Down Expand Up @@ -609,7 +609,7 @@ static struct dmi_system_id video_dmi_table[] __initdata = {

static int
acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
unsigned long long *level)
unsigned long long *level, int init)
{
acpi_status status = AE_OK;
int i;
Expand All @@ -633,10 +633,16 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
device->brightness->curr = *level;
return 0;
}
/* BQC returned an invalid level. Stop using it. */
ACPI_WARNING((AE_INFO, "%s returned an invalid level",
buf));
device->cap._BQC = device->cap._BCQ = 0;
if (!init) {
/*
* BQC returned an invalid level.
* Stop using it.
*/
ACPI_WARNING((AE_INFO,
"%s returned an invalid level",
buf));
device->cap._BQC = device->cap._BCQ = 0;
}
} else {
/* Fixme:
* should we return an error or ignore this failure?
Expand Down Expand Up @@ -892,7 +898,7 @@ acpi_video_init_brightness(struct acpi_video_device *device)
if (!device->cap._BQC)
goto set_level;

result = acpi_video_device_lcd_get_level_current(device, &level_old);
result = acpi_video_device_lcd_get_level_current(device, &level_old, 1);
if (result)
goto out_free_levels;

Expand All @@ -903,7 +909,7 @@ acpi_video_init_brightness(struct acpi_video_device *device)
if (result)
goto out_free_levels;

result = acpi_video_device_lcd_get_level_current(device, &level);
result = acpi_video_device_lcd_get_level_current(device, &level, 0);
if (result)
goto out_free_levels;

Expand Down Expand Up @@ -1996,7 +2002,7 @@ acpi_video_switch_brightness(struct acpi_video_device *device, int event)
goto out;

result = acpi_video_device_lcd_get_level_current(device,
&level_current);
&level_current, 0);
if (result)
goto out;

Expand Down

0 comments on commit 3d3329e

Please sign in to comment.