Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84059
b: refs/heads/master
c: f8d1c94
h: refs/heads/master
i:
  84057: 664d1fc
  84055: d9bee1b
v: v3
  • Loading branch information
Corentin CHARY authored and Len Brown committed Feb 7, 2008
1 parent 1f7a7bb commit 2b78d1c
Show file tree
Hide file tree
Showing 6 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: 877c357e7511395bc923ec9efc2e8b021a17ed79
refs/heads/master: f8d1c94b346b62747322728e00e11f552cd90902
5 changes: 0 additions & 5 deletions trunk/drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@ static int acpi_battery_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_MANUFACTURER:
val->strval = battery->oem_info;
break;
case POWER_SUPPLY_PROP_SERIAL_NUMBER:
val->strval = battery->serial_number;
break;
default:
return -EINVAL;
}
Expand All @@ -215,7 +212,6 @@ static enum power_supply_property charge_battery_props[] = {
POWER_SUPPLY_PROP_CHARGE_NOW,
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER,
POWER_SUPPLY_PROP_SERIAL_NUMBER,
};

static enum power_supply_property energy_battery_props[] = {
Expand All @@ -230,7 +226,6 @@ static enum power_supply_property energy_battery_props[] = {
POWER_SUPPLY_PROP_ENERGY_NOW,
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER,
POWER_SUPPLY_PROP_SERIAL_NUMBER,
};
#endif

Expand Down
15 changes: 3 additions & 12 deletions trunk/drivers/acpi/sleep/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,20 +472,11 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
if (acpi_target_sleep_state == ACPI_STATE_S0 ||
(wake && adev->wakeup.state.enabled &&
adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
acpi_status status;

acpi_method[3] = 'W';
status = acpi_evaluate_integer(handle, acpi_method, NULL,
&d_max);
if (ACPI_FAILURE(status)) {
d_max = d_min;
} else if (d_max < d_min) {
/* Warn the user of the broken DSDT */
printk(KERN_WARNING "ACPI: Wrong value from %s\n",
acpi_method);
/* Sanitize it */
acpi_evaluate_integer(handle, acpi_method, NULL, &d_max);
/* Sanity check */
if (d_max < d_min)
d_min = d_max;
}
}

if (d_min_p)
Expand Down
24 changes: 15 additions & 9 deletions trunk/drivers/misc/asus-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ ASUS_LED(gled, "gaming");
* method is searched within the scope of the handle, can be NULL. The output
* of the method is written is output, which can also be NULL
*
* returns 1 if write is successful, 0 else.
* returns 0 if write is successful, -1 else.
*/
static int write_acpi_int(acpi_handle handle, const char *method, int val,
struct acpi_buffer *output)
Expand All @@ -263,13 +263,19 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val,
union acpi_object in_obj; //the only param we use
acpi_status status;

if (!handle)
return 0;

params.count = 1;
params.pointer = &in_obj;
in_obj.type = ACPI_TYPE_INTEGER;
in_obj.integer.value = val;

status = acpi_evaluate_object(handle, (char *)method, &params, output);
return (status == AE_OK);
if (status == AE_OK)
return 0;
else
return -1;
}

static int read_wireless_status(int mask)
Expand Down Expand Up @@ -335,7 +341,7 @@ static void write_status(acpi_handle handle, int out, int mask)
break;
}

if (handle && !write_acpi_int(handle, NULL, out, NULL))
if (write_acpi_int(handle, NULL, out, NULL))
printk(ASUS_WARNING " write failed %x\n", mask);
}

Expand Down Expand Up @@ -415,7 +421,7 @@ static int set_brightness(struct backlight_device *bd, int value)
value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
/* 0 <= value <= 15 */

if (!write_acpi_int(brightness_set_handle, NULL, value, NULL)) {
if (write_acpi_int(brightness_set_handle, NULL, value, NULL)) {
printk(ASUS_WARNING "Error changing brightness\n");
ret = -EIO;
}
Expand Down Expand Up @@ -545,7 +551,7 @@ static ssize_t store_ledd(struct device *dev, struct device_attribute *attr,

rv = parse_arg(buf, count, &value);
if (rv > 0) {
if (!write_acpi_int(ledd_set_handle, NULL, value, NULL))
if (write_acpi_int(ledd_set_handle, NULL, value, NULL))
printk(ASUS_WARNING "LED display write failed\n");
else
hotk->ledd_status = (u32) value;
Expand Down Expand Up @@ -590,7 +596,7 @@ static ssize_t store_bluetooth(struct device *dev,
static void set_display(int value)
{
/* no sanity check needed for now */
if (!write_acpi_int(display_set_handle, NULL, value, NULL))
if (write_acpi_int(display_set_handle, NULL, value, NULL))
printk(ASUS_WARNING "Error setting display\n");
return;
}
Expand Down Expand Up @@ -647,7 +653,7 @@ static ssize_t store_disp(struct device *dev, struct device_attribute *attr,
*/
static void set_light_sens_switch(int value)
{
if (!write_acpi_int(ls_switch_handle, NULL, value, NULL))
if (write_acpi_int(ls_switch_handle, NULL, value, NULL))
printk(ASUS_WARNING "Error setting light sensor switch\n");
hotk->light_switch = value;
}
Expand All @@ -672,7 +678,7 @@ static ssize_t store_lssw(struct device *dev, struct device_attribute *attr,

static void set_light_sens_level(int value)
{
if (!write_acpi_int(ls_level_handle, NULL, value, NULL))
if (write_acpi_int(ls_level_handle, NULL, value, NULL))
printk(ASUS_WARNING "Error setting light sensor level\n");
hotk->light_level = value;
}
Expand Down Expand Up @@ -860,7 +866,7 @@ static int asus_hotk_get_info(void)
printk(ASUS_WARNING "Couldn't get the DSDT table header\n");

/* We have to write 0 on init this far for all ASUS models */
if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {
if (write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {
printk(ASUS_ERR "Hotkey initialization failed\n");
return -ENODEV;
}
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/power/power_supply_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ static struct device_attribute power_supply_attrs[] = {
/* Properties of type `const char *' */
POWER_SUPPLY_ATTR(model_name),
POWER_SUPPLY_ATTR(manufacturer),
POWER_SUPPLY_ATTR(serial_number),
};

static ssize_t power_supply_show_static_attrs(struct device *dev,
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/power_supply.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ enum power_supply_property {
/* Properties of type `const char *' */
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER,
POWER_SUPPLY_PROP_SERIAL_NUMBER,
};

enum power_supply_type {
Expand Down

0 comments on commit 2b78d1c

Please sign in to comment.