* [PATCH] power: Rename get_current to fix build failure / name conflict
@ 2010-05-12 23:54 Peter Huewe
2010-05-13 0:32 ` Ryan Mallon
2010-05-13 5:27 ` Mike Rapoport
0 siblings, 2 replies; 5+ messages in thread
From: Peter Huewe @ 2010-05-12 23:54 UTC (permalink / raw)
To: Anton Vorontsov
Cc: Mike Rapoport, Wolfram Sang, Tejun Heo, Ryan Mallon, linux-kernel
From: Peter Huewe <peterhuewe@gmx.de>
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 which is resolved by this patch.
To be consistent the other function pointers (_voltage,_capacity) were
renamed too.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
KernelVersion: linux-next 20100512
References:
[1] http://kisskb.ellerman.id.au/kisskb/buildresult/2572665/
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 d762a0c..9b3b4b7 100644
--- a/drivers/power/ds2782_battery.c
+++ b/drivers/power/ds2782_battery.c
@@ -43,10 +43,9 @@
struct ds278x_info;
struct ds278x_battery_ops {
- int (*get_current)(struct ds278x_info *info, int *current_uA);
- int (*get_voltage)(struct ds278x_info *info, int *voltage_uA);
- int (*get_capacity)(struct ds278x_info *info, int *capacity_uA);
-
+ int (*get_battery_current)(struct ds278x_info *info, int *current_uA);
+ int (*get_battery_voltage)(struct ds278x_info *info, int *voltage_uA);
+ int (*get_battery_capacity)(struct ds278x_info *info, int *capacity_uA);
};
#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)
int current_uA;
int capacity;
- err = info->ops->get_current(info, ¤t_uA);
+ err = info->ops->get_battery_current(info, ¤t_uA);
if (err)
return err;
- err = info->ops->get_capacity(info, &capacity);
+ err = info->ops->get_battery_capacity(info, &capacity);
if (err)
return err;
@@ -246,15 +245,15 @@ static int ds278x_battery_get_property(struct power_supply *psy,
break;
case POWER_SUPPLY_PROP_CAPACITY:
- ret = info->ops->get_capacity(info, &val->intval);
+ ret = info->ops->get_battery_capacity(info, &val->intval);
break;
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
- ret = info->ops->get_voltage(info, &val->intval);
+ ret = info->ops->get_battery_voltage(info, &val->intval);
break;
case POWER_SUPPLY_PROP_CURRENT_NOW:
- ret = info->ops->get_current(info, &val->intval);
+ ret = info->ops->get_battery_current(info, &val->intval);
break;
case POWER_SUPPLY_PROP_TEMP:
@@ -307,14 +306,14 @@ enum ds278x_num_id {
static struct ds278x_battery_ops ds278x_ops[] = {
[DS2782] = {
- .get_current = ds2782_get_current,
- .get_voltage = ds2782_get_voltage,
- .get_capacity = ds2782_get_capacity,
+ .get_battery_current = ds2782_get_current,
+ .get_battery_voltage = ds2782_get_voltage,
+ .get_battery_capacity = ds2782_get_capacity,
},
[DS2786] = {
- .get_current = ds2786_get_current,
- .get_voltage = ds2786_get_voltage,
- .get_capacity = ds2786_get_capacity,
+ .get_battery_current = ds2786_get_current,
+ .get_battery_voltage = ds2786_get_voltage,
+ .get_battery_capacity = ds2786_get_capacity,
}
};
--
1.6.4.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] power: Rename get_current to fix build failure / name conflict
2010-05-12 23:54 [PATCH] power: Rename get_current to fix build failure / name conflict Peter Huewe
@ 2010-05-13 0:32 ` Ryan Mallon
2010-05-13 5:27 ` Mike Rapoport
1 sibling, 0 replies; 5+ messages in thread
From: Ryan Mallon @ 2010-05-13 0:32 UTC (permalink / raw)
To: Peter Huewe
Cc: Anton Vorontsov, Mike Rapoport, Wolfram Sang, Tejun Heo,
linux-kernel
Peter Huewe wrote:
> From: Peter Huewe <peterhuewe@gmx.de>
>
> 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 which is resolved by this patch.
Ah, didn't think of that. Thanks.
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
> To be consistent the other function pointers (_voltage,_capacity) were
> renamed too.
>
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
> ---
> KernelVersion: linux-next 20100512
> References:
> [1] http://kisskb.ellerman.id.au/kisskb/buildresult/2572665/
>
> 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 d762a0c..9b3b4b7 100644
> --- a/drivers/power/ds2782_battery.c
> +++ b/drivers/power/ds2782_battery.c
> @@ -43,10 +43,9 @@
> struct ds278x_info;
>
> struct ds278x_battery_ops {
> - int (*get_current)(struct ds278x_info *info, int *current_uA);
> - int (*get_voltage)(struct ds278x_info *info, int *voltage_uA);
> - int (*get_capacity)(struct ds278x_info *info, int *capacity_uA);
> -
> + int (*get_battery_current)(struct ds278x_info *info, int *current_uA);
> + int (*get_battery_voltage)(struct ds278x_info *info, int *voltage_uA);
> + int (*get_battery_capacity)(struct ds278x_info *info, int *capacity_uA);
> };
>
> #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)
> int current_uA;
> int capacity;
>
> - err = info->ops->get_current(info, ¤t_uA);
> + err = info->ops->get_battery_current(info, ¤t_uA);
> if (err)
> return err;
>
> - err = info->ops->get_capacity(info, &capacity);
> + err = info->ops->get_battery_capacity(info, &capacity);
> if (err)
> return err;
>
> @@ -246,15 +245,15 @@ static int ds278x_battery_get_property(struct power_supply *psy,
> break;
>
> case POWER_SUPPLY_PROP_CAPACITY:
> - ret = info->ops->get_capacity(info, &val->intval);
> + ret = info->ops->get_battery_capacity(info, &val->intval);
> break;
>
> case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> - ret = info->ops->get_voltage(info, &val->intval);
> + ret = info->ops->get_battery_voltage(info, &val->intval);
> break;
>
> case POWER_SUPPLY_PROP_CURRENT_NOW:
> - ret = info->ops->get_current(info, &val->intval);
> + ret = info->ops->get_battery_current(info, &val->intval);
> break;
>
> case POWER_SUPPLY_PROP_TEMP:
> @@ -307,14 +306,14 @@ enum ds278x_num_id {
>
> static struct ds278x_battery_ops ds278x_ops[] = {
> [DS2782] = {
> - .get_current = ds2782_get_current,
> - .get_voltage = ds2782_get_voltage,
> - .get_capacity = ds2782_get_capacity,
> + .get_battery_current = ds2782_get_current,
> + .get_battery_voltage = ds2782_get_voltage,
> + .get_battery_capacity = ds2782_get_capacity,
> },
> [DS2786] = {
> - .get_current = ds2786_get_current,
> - .get_voltage = ds2786_get_voltage,
> - .get_capacity = ds2786_get_capacity,
> + .get_battery_current = ds2786_get_current,
> + .get_battery_voltage = ds2786_get_voltage,
> + .get_battery_capacity = ds2786_get_capacity,
> }
> };
>
--
Bluewater Systems Ltd - ARM Technology Solution Centre
Ryan Mallon 5 Amuri Park, 404 Barbadoes St
ryan@bluewatersys.com PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com New Zealand
Phone: +64 3 3779127 Freecall: Australia 1800 148 751
Fax: +64 3 3779135 USA 1800 261 2934
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] power: Rename get_current to fix build failure / name conflict
2010-05-12 23:54 [PATCH] power: Rename get_current to fix build failure / name conflict Peter Huewe
2010-05-13 0:32 ` Ryan Mallon
@ 2010-05-13 5:27 ` Mike Rapoport
2010-06-14 15:12 ` Peter Huewe
1 sibling, 1 reply; 5+ messages in thread
From: Mike Rapoport @ 2010-05-13 5:27 UTC (permalink / raw)
To: Peter Huewe
Cc: Anton Vorontsov, Wolfram Sang, Tejun Heo, Ryan Mallon,
linux-kernel
Peter Huewe wrote:
> From: Peter Huewe <peterhuewe@gmx.de>
>
> 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 which is resolved by this patch.
>
> To be consistent the other function pointers (_voltage,_capacity) were
> renamed too.
>
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Mike Rapoport <mike@compulab.co.il>
> ---
> KernelVersion: linux-next 20100512
> References:
> [1] http://kisskb.ellerman.id.au/kisskb/buildresult/2572665/
>
> 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 d762a0c..9b3b4b7 100644
> --- a/drivers/power/ds2782_battery.c
> +++ b/drivers/power/ds2782_battery.c
> @@ -43,10 +43,9 @@
> struct ds278x_info;
>
> struct ds278x_battery_ops {
> - int (*get_current)(struct ds278x_info *info, int *current_uA);
> - int (*get_voltage)(struct ds278x_info *info, int *voltage_uA);
> - int (*get_capacity)(struct ds278x_info *info, int *capacity_uA);
> -
> + int (*get_battery_current)(struct ds278x_info *info, int *current_uA);
> + int (*get_battery_voltage)(struct ds278x_info *info, int *voltage_uA);
> + int (*get_battery_capacity)(struct ds278x_info *info, int *capacity_uA);
> };
>
> #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)
> int current_uA;
> int capacity;
>
> - err = info->ops->get_current(info, ¤t_uA);
> + err = info->ops->get_battery_current(info, ¤t_uA);
> if (err)
> return err;
>
> - err = info->ops->get_capacity(info, &capacity);
> + err = info->ops->get_battery_capacity(info, &capacity);
> if (err)
> return err;
>
> @@ -246,15 +245,15 @@ static int ds278x_battery_get_property(struct power_supply *psy,
> break;
>
> case POWER_SUPPLY_PROP_CAPACITY:
> - ret = info->ops->get_capacity(info, &val->intval);
> + ret = info->ops->get_battery_capacity(info, &val->intval);
> break;
>
> case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> - ret = info->ops->get_voltage(info, &val->intval);
> + ret = info->ops->get_battery_voltage(info, &val->intval);
> break;
>
> case POWER_SUPPLY_PROP_CURRENT_NOW:
> - ret = info->ops->get_current(info, &val->intval);
> + ret = info->ops->get_battery_current(info, &val->intval);
> break;
>
> case POWER_SUPPLY_PROP_TEMP:
> @@ -307,14 +306,14 @@ enum ds278x_num_id {
>
> static struct ds278x_battery_ops ds278x_ops[] = {
> [DS2782] = {
> - .get_current = ds2782_get_current,
> - .get_voltage = ds2782_get_voltage,
> - .get_capacity = ds2782_get_capacity,
> + .get_battery_current = ds2782_get_current,
> + .get_battery_voltage = ds2782_get_voltage,
> + .get_battery_capacity = ds2782_get_capacity,
> },
> [DS2786] = {
> - .get_current = ds2786_get_current,
> - .get_voltage = ds2786_get_voltage,
> - .get_capacity = ds2786_get_capacity,
> + .get_battery_current = ds2786_get_current,
> + .get_battery_voltage = ds2786_get_voltage,
> + .get_battery_capacity = ds2786_get_capacity,
> }
> };
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] power: Rename get_current to fix build failure / name conflict
2010-05-13 5:27 ` Mike Rapoport
@ 2010-06-14 15:12 ` Peter Huewe
2010-06-14 15:41 ` Anton Vorontsov
0 siblings, 1 reply; 5+ messages in thread
From: Peter Huewe @ 2010-06-14 15:12 UTC (permalink / raw)
To: Mike Rapoport
Cc: Anton Vorontsov, Wolfram Sang, Tejun Heo, Ryan Mallon,
linux-kernel, linux-sh, sfr, Linus Torvalds
Am Donnerstag 13 Mai 2010 07:27:28 schrieb Mike Rapoport:
> Peter Huewe wrote:
> > From: Peter Huewe <peterhuewe@gmx.de>
> >
> > 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 which is resolved by this patch.
> >
> > 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>
Unfortunately this build-failure still exists, in Linux-next and hit Linus'
Tree :/
References:
http://kisskb.ellerman.id.au/kisskb/buildresult/2709436/
http://kisskb.ellerman.id.au/kisskb/buildresult/2687686/
Thanks,
Peter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] power: Rename get_current to fix build failure / name conflict
2010-06-14 15:12 ` Peter Huewe
@ 2010-06-14 15:41 ` Anton Vorontsov
0 siblings, 0 replies; 5+ messages in thread
From: Anton Vorontsov @ 2010-06-14 15:41 UTC (permalink / raw)
To: Peter Huewe
Cc: Mike Rapoport, Wolfram Sang, Tejun Heo, Ryan Mallon, linux-kernel,
linux-sh, sfr, Linus Torvalds
On Mon, Jun 14, 2010 at 05:12:22PM +0200, Peter Huewe wrote:
> Am Donnerstag 13 Mai 2010 07:27:28 schrieb Mike Rapoport:
> > Peter Huewe wrote:
> > > From: Peter Huewe <peterhuewe@gmx.de>
> > >
> > > 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 which is resolved by this patch.
> > >
> > > 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>
>
> Unfortunately this build-failure still exists, in Linux-next and hit Linus'
> Tree :/
>
> References:
> http://kisskb.ellerman.id.au/kisskb/buildresult/2709436/
> http://kisskb.ellerman.id.au/kisskb/buildresult/2687686/
Thanks for the patch.
As this is not a 2.6.35 regression, and only affects just
a few embedded platforms, I think this can wait for the next
merge window.
So, applied to battery-2.6.git (for -next).
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-06-14 15:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-12 23:54 [PATCH] power: Rename get_current to fix build failure / name conflict Peter Huewe
2010-05-13 0:32 ` Ryan Mallon
2010-05-13 5:27 ` Mike Rapoport
2010-06-14 15:12 ` Peter Huewe
2010-06-14 15:41 ` Anton Vorontsov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).