diff options
Diffstat (limited to 'drivers/power/apm_power.c')
| -rw-r--r-- | drivers/power/apm_power.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/power/apm_power.c b/drivers/power/apm_power.c index a4892275659..39763015b36 100644 --- a/drivers/power/apm_power.c +++ b/drivers/power/apm_power.c @@ -10,15 +10,16 @@ */ #include <linux/module.h> +#include <linux/device.h> #include <linux/power_supply.h> #include <linux/apm-emulation.h> -#define PSY_PROP(psy, prop, val) psy->get_property(psy, \ - POWER_SUPPLY_PROP_##prop, val) +#define PSY_PROP(psy, prop, val) (psy->get_property(psy, \ + POWER_SUPPLY_PROP_##prop, val)) -#define _MPSY_PROP(prop, val) main_battery->get_property(main_battery, \ - prop, val) +#define _MPSY_PROP(prop, val) (main_battery->get_property(main_battery, \ + prop, val)) #define MPSY_PROP(prop, val) _MPSY_PROP(POWER_SUPPLY_PROP_##prop, val) @@ -78,7 +79,7 @@ static void find_main_battery(void) main_battery = NULL; bp.main = main_battery; - error = class_for_each_device(power_supply_class, &bp, + error = class_for_each_device(power_supply_class, NULL, &bp, __find_main_battery); if (error) { main_battery = bp.main; @@ -233,6 +234,7 @@ static int calculate_capacity(enum apm_source source) empty_design_prop = POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN; now_prop = POWER_SUPPLY_PROP_ENERGY_NOW; avg_prop = POWER_SUPPLY_PROP_ENERGY_AVG; + break; case SOURCE_VOLTAGE: full_prop = POWER_SUPPLY_PROP_VOLTAGE_MAX; empty_prop = POWER_SUPPLY_PROP_VOLTAGE_MIN; |
