diff options
author | Peter Huewe <peterhuewe@gmx.de> | 2010-05-12 19:54:57 -0400 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2010-06-14 11:33:22 -0400 |
commit | eb9650d6d989f24f21232a055d8fd45f1a9dcf99 (patch) | |
tree | 14245e56a2054a23429a6de2be9542b23e00b191 /drivers/power | |
parent | 7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff) |
ds2782_battery: Rename get_current to fix build failure / name conflict
This patch changes the name of get_current function pointer to
get_battery_current to resolve a name conflict with the get_current
macro defined in current.h.
This conflict resulted in a build-failure[1] for the sh4 arch
allyesconfig:
drivers/power/ds2782_battery.c:216:48: error: macro "get_current"
passed 2 arguments, but takes just
This patch fixes the issue. To be consistent the other function pointers
(_voltage,_capacity) were renamed too.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Acked-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/ds2782_battery.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c index d762a0cbc6af..9b3b4b70f6f3 100644 --- a/drivers/power/ds2782_battery.c +++ b/drivers/power/ds2782_battery.c | |||
@@ -43,10 +43,9 @@ | |||
43 | struct ds278x_info; | 43 | struct ds278x_info; |
44 | 44 | ||
45 | struct ds278x_battery_ops { | 45 | struct ds278x_battery_ops { |
46 | int (*get_current)(struct ds278x_info *info, int *current_uA); | 46 | int (*get_battery_current)(struct ds278x_info *info, int *current_uA); |
47 | int (*get_voltage)(struct ds278x_info *info, int *voltage_uA); | 47 | int (*get_battery_voltage)(struct ds278x_info *info, int *voltage_uA); |
48 | int (*get_capacity)(struct ds278x_info *info, int *capacity_uA); | 48 | int (*get_battery_capacity)(struct ds278x_info *info, int *capacity_uA); |
49 | |||
50 | }; | 49 | }; |
51 | 50 | ||
52 | #define to_ds278x_info(x) container_of(x, struct ds278x_info, battery) | 51 | #define to_ds278x_info(x) container_of(x, struct ds278x_info, battery) |
@@ -213,11 +212,11 @@ static int ds278x_get_status(struct ds278x_info *info, int *status) | |||
213 | int current_uA; | 212 | int current_uA; |
214 | int capacity; | 213 | int capacity; |
215 | 214 | ||
216 | err = info->ops->get_current(info, ¤t_uA); | 215 | err = info->ops->get_battery_current(info, ¤t_uA); |
217 | if (err) | 216 | if (err) |
218 | return err; | 217 | return err; |
219 | 218 | ||
220 | err = info->ops->get_capacity(info, &capacity); | 219 | err = info->ops->get_battery_capacity(info, &capacity); |
221 | if (err) | 220 | if (err) |
222 | return err; | 221 | return err; |
223 | 222 | ||
@@ -246,15 +245,15 @@ static int ds278x_battery_get_property(struct power_supply *psy, | |||
246 | break; | 245 | break; |
247 | 246 | ||
248 | case POWER_SUPPLY_PROP_CAPACITY: | 247 | case POWER_SUPPLY_PROP_CAPACITY: |
249 | ret = info->ops->get_capacity(info, &val->intval); | 248 | ret = info->ops->get_battery_capacity(info, &val->intval); |
250 | break; | 249 | break; |
251 | 250 | ||
252 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: | 251 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: |
253 | ret = info->ops->get_voltage(info, &val->intval); | 252 | ret = info->ops->get_battery_voltage(info, &val->intval); |
254 | break; | 253 | break; |
255 | 254 | ||
256 | case POWER_SUPPLY_PROP_CURRENT_NOW: | 255 | case POWER_SUPPLY_PROP_CURRENT_NOW: |
257 | ret = info->ops->get_current(info, &val->intval); | 256 | ret = info->ops->get_battery_current(info, &val->intval); |
258 | break; | 257 | break; |
259 | 258 | ||
260 | case POWER_SUPPLY_PROP_TEMP: | 259 | case POWER_SUPPLY_PROP_TEMP: |
@@ -307,14 +306,14 @@ enum ds278x_num_id { | |||
307 | 306 | ||
308 | static struct ds278x_battery_ops ds278x_ops[] = { | 307 | static struct ds278x_battery_ops ds278x_ops[] = { |
309 | [DS2782] = { | 308 | [DS2782] = { |
310 | .get_current = ds2782_get_current, | 309 | .get_battery_current = ds2782_get_current, |
311 | .get_voltage = ds2782_get_voltage, | 310 | .get_battery_voltage = ds2782_get_voltage, |
312 | .get_capacity = ds2782_get_capacity, | 311 | .get_battery_capacity = ds2782_get_capacity, |
313 | }, | 312 | }, |
314 | [DS2786] = { | 313 | [DS2786] = { |
315 | .get_current = ds2786_get_current, | 314 | .get_battery_current = ds2786_get_current, |
316 | .get_voltage = ds2786_get_voltage, | 315 | .get_battery_voltage = ds2786_get_voltage, |
317 | .get_capacity = ds2786_get_capacity, | 316 | .get_battery_capacity = ds2786_get_capacity, |
318 | } | 317 | } |
319 | }; | 318 | }; |
320 | 319 | ||