linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ds2782_battery: Rename get_current and get_voltage operations
@ 2010-07-20  0:02 Ben Hutchings
  2010-07-20  7:46 ` Anton Vorontsov
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2010-07-20  0:02 UTC (permalink / raw)
  To: Anton Vorontsov, David Woodhouse; +Cc: Yulia Vilensky, Geert Stappers, LKML

commit 9b9ade6b612e562c4a5bd02ef38cc32e10f3f9ba "ds2782_battery: Add
support for ds2786 battery gas gauge" introduced an operation named
get_current.  Since get_current() is defined as a macro on some
architectures this driver no longer compiles on those architectures.

Rename get_current to get_current_now to avoid the macro.
Rename get_voltage to get_voltage_now for consistency.

Reported-by: Geert Stappers <stappers@stappers.nl>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/power/ds2782_battery.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c
index d762a0c..8d0673f 100644
--- a/drivers/power/ds2782_battery.c
+++ b/drivers/power/ds2782_battery.c
@@ -43,8 +43,8 @@
 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_current_now)(struct ds278x_info *info, int *current_uA);
+	int	(*get_voltage_now)(struct ds278x_info *info, int *voltage_uA);
 	int	(*get_capacity)(struct ds278x_info *info, int *capacity_uA);
 
 };
@@ -213,7 +213,7 @@ static int ds278x_get_status(struct ds278x_info *info, int *status)
 	int current_uA;
 	int capacity;
 
-	err = info->ops->get_current(info, &current_uA);
+	err = info->ops->get_current_now(info, &current_uA);
 	if (err)
 		return err;
 
@@ -250,11 +250,11 @@ static int ds278x_battery_get_property(struct power_supply *psy,
 		break;
 
 	case POWER_SUPPLY_PROP_VOLTAGE_NOW:
-		ret = info->ops->get_voltage(info, &val->intval);
+		ret = info->ops->get_voltage_now(info, &val->intval);
 		break;
 
 	case POWER_SUPPLY_PROP_CURRENT_NOW:
-		ret = info->ops->get_current(info, &val->intval);
+		ret = info->ops->get_current_now(info, &val->intval);
 		break;
 
 	case POWER_SUPPLY_PROP_TEMP:
@@ -307,14 +307,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_current_now = ds2782_get_current,
+		.get_voltage_now = ds2782_get_voltage,
+		.get_capacity    = ds2782_get_capacity,
 	},
 	[DS2786] = {
-		.get_current  = ds2786_get_current,
-		.get_voltage  = ds2786_get_voltage,
-		.get_capacity = ds2786_get_capacity,
+		.get_current_now = ds2786_get_current,
+		.get_voltage_now = ds2786_get_voltage,
+		.get_capacity    = ds2786_get_capacity,
 	}
 };
 
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ds2782_battery: Rename get_current and get_voltage operations
  2010-07-20  0:02 [PATCH] ds2782_battery: Rename get_current and get_voltage operations Ben Hutchings
@ 2010-07-20  7:46 ` Anton Vorontsov
  2010-07-20  9:44   ` Ben Hutchings
  0 siblings, 1 reply; 6+ messages in thread
From: Anton Vorontsov @ 2010-07-20  7:46 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David Woodhouse, Yulia Vilensky, Geert Stappers, LKML

On Tue, Jul 20, 2010 at 01:02:55AM +0100, Ben Hutchings wrote:
> commit 9b9ade6b612e562c4a5bd02ef38cc32e10f3f9ba "ds2782_battery: Add
> support for ds2786 battery gas gauge" introduced an operation named
> get_current.  Since get_current() is defined as a macro on some
> architectures this driver no longer compiles on those architectures.
> 
> Rename get_current to get_current_now to avoid the macro.
> Rename get_voltage to get_voltage_now for consistency.
> 
> Reported-by: Geert Stappers <stappers@stappers.nl>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---

Thanks for the patch, but I have a similar fix in the
battery-2.6.git tree (for -next):

commit eb9650d6d989f24f21232a055d8fd45f1a9dcf99
Author: Peter Huewe <peterhuewe@gmx.de>
Date:   Thu May 13 01:54:57 2010 +0200

    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>

I'm not pushing this into 2.6.35 as this is not a 2.6.35 regression,
it's there since 2.6.33, and nobody seemed to care for two releases.
So, I'm not considering this as urgent.

Thanks!

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ds2782_battery: Rename get_current and get_voltage operations
  2010-07-20  7:46 ` Anton Vorontsov
@ 2010-07-20  9:44   ` Ben Hutchings
  2010-07-20 10:57     ` Anton Vorontsov
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2010-07-20  9:44 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: David Woodhouse, Yulia Vilensky, Geert Stappers, LKML

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]

On Tue, 2010-07-20 at 11:46 +0400, Anton Vorontsov wrote:
> On Tue, Jul 20, 2010 at 01:02:55AM +0100, Ben Hutchings wrote:
> > commit 9b9ade6b612e562c4a5bd02ef38cc32e10f3f9ba "ds2782_battery: Add
> > support for ds2786 battery gas gauge" introduced an operation named
> > get_current.  Since get_current() is defined as a macro on some
> > architectures this driver no longer compiles on those architectures.
> > 
> > Rename get_current to get_current_now to avoid the macro.
> > Rename get_voltage to get_voltage_now for consistency.
> > 
> > Reported-by: Geert Stappers <stappers@stappers.nl>
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > ---
> 
> Thanks for the patch, but I have a similar fix in the
> battery-2.6.git tree (for -next):
[...]

This fix needs to go into 2.6.35.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ds2782_battery: Rename get_current and get_voltage operations
  2010-07-20  9:44   ` Ben Hutchings
@ 2010-07-20 10:57     ` Anton Vorontsov
  2010-07-20 11:50       ` Ben Hutchings
  0 siblings, 1 reply; 6+ messages in thread
From: Anton Vorontsov @ 2010-07-20 10:57 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David Woodhouse, Yulia Vilensky, Geert Stappers, LKML

On Tue, Jul 20, 2010 at 10:44:26AM +0100, Ben Hutchings wrote:
> On Tue, 2010-07-20 at 11:46 +0400, Anton Vorontsov wrote:
> > On Tue, Jul 20, 2010 at 01:02:55AM +0100, Ben Hutchings wrote:
> > > commit 9b9ade6b612e562c4a5bd02ef38cc32e10f3f9ba "ds2782_battery: Add
> > > support for ds2786 battery gas gauge" introduced an operation named
> > > get_current.  Since get_current() is defined as a macro on some
> > > architectures this driver no longer compiles on those architectures.
> > > 
> > > Rename get_current to get_current_now to avoid the macro.
> > > Rename get_voltage to get_voltage_now for consistency.
> > > 
> > > Reported-by: Geert Stappers <stappers@stappers.nl>
> > > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > > ---
> > 
> > Thanks for the patch, but I have a similar fix in the
> > battery-2.6.git tree (for -next):
> [...]
> 
> This fix needs to go into 2.6.35.

Did you read why I don't push it into 2.6.35? Reread my email,
pay attention to the very bottom.

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ds2782_battery: Rename get_current and get_voltage operations
  2010-07-20 10:57     ` Anton Vorontsov
@ 2010-07-20 11:50       ` Ben Hutchings
  2010-07-20 12:32         ` Anton Vorontsov
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2010-07-20 11:50 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: David Woodhouse, Yulia Vilensky, Geert Stappers, LKML

On Tue, Jul 20, 2010 at 02:57:12PM +0400, Anton Vorontsov wrote:
> On Tue, Jul 20, 2010 at 10:44:26AM +0100, Ben Hutchings wrote:
> > On Tue, 2010-07-20 at 11:46 +0400, Anton Vorontsov wrote:
> > > On Tue, Jul 20, 2010 at 01:02:55AM +0100, Ben Hutchings wrote:
> > > > commit 9b9ade6b612e562c4a5bd02ef38cc32e10f3f9ba "ds2782_battery: Add
> > > > support for ds2786 battery gas gauge" introduced an operation named
> > > > get_current.  Since get_current() is defined as a macro on some
> > > > architectures this driver no longer compiles on those architectures.
> > > > 
> > > > Rename get_current to get_current_now to avoid the macro.
> > > > Rename get_voltage to get_voltage_now for consistency.
> > > > 
> > > > Reported-by: Geert Stappers <stappers@stappers.nl>
> > > > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > > > ---
> > > 
> > > Thanks for the patch, but I have a similar fix in the
> > > battery-2.6.git tree (for -next):
> > [...]
> > 
> > This fix needs to go into 2.6.35.
> 
> Did you read why I don't push it into 2.6.35? Reread my email,
> pay attention to the very bottom.

It is a 2.6.35 regression; these operations were introduced in 2.6.35-rc1.
(Hint: use 'git describe --contains' not 'git describe'.  Or even
'git grep -w get_current v2.6.34:drivers/power/ds2782_battery.c'.)

Ben.

-- 
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
                                                              - Albert Camus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ds2782_battery: Rename get_current and get_voltage operations
  2010-07-20 11:50       ` Ben Hutchings
@ 2010-07-20 12:32         ` Anton Vorontsov
  0 siblings, 0 replies; 6+ messages in thread
From: Anton Vorontsov @ 2010-07-20 12:32 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David Woodhouse, Yulia Vilensky, Geert Stappers, LKML

On Tue, Jul 20, 2010 at 12:50:19PM +0100, Ben Hutchings wrote:
> On Tue, Jul 20, 2010 at 02:57:12PM +0400, Anton Vorontsov wrote:
> > On Tue, Jul 20, 2010 at 10:44:26AM +0100, Ben Hutchings wrote:
> > > On Tue, 2010-07-20 at 11:46 +0400, Anton Vorontsov wrote:
> > > > On Tue, Jul 20, 2010 at 01:02:55AM +0100, Ben Hutchings wrote:
> > > > > commit 9b9ade6b612e562c4a5bd02ef38cc32e10f3f9ba "ds2782_battery: Add
> > > > > support for ds2786 battery gas gauge" introduced an operation named
> > > > > get_current.  Since get_current() is defined as a macro on some
> > > > > architectures this driver no longer compiles on those architectures.
> > > > > 
> > > > > Rename get_current to get_current_now to avoid the macro.
> > > > > Rename get_voltage to get_voltage_now for consistency.
> > > > > 
> > > > > Reported-by: Geert Stappers <stappers@stappers.nl>
> > > > > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > > > > ---
> > > > 
> > > > Thanks for the patch, but I have a similar fix in the
> > > > battery-2.6.git tree (for -next):
> > > [...]
> > > 
> > > This fix needs to go into 2.6.35.
> > 
> > Did you read why I don't push it into 2.6.35? Reread my email,
> > pay attention to the very bottom.
> 
> It is a 2.6.35 regression; these operations were introduced in 2.6.35-rc1.
> (Hint: use 'git describe --contains' not 'git describe'.  Or even
> 'git grep -w get_current v2.6.34:drivers/power/ds2782_battery.c'.)

Oh, I got it.

Will push, thanks!

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-20 12:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-20  0:02 [PATCH] ds2782_battery: Rename get_current and get_voltage operations Ben Hutchings
2010-07-20  7:46 ` Anton Vorontsov
2010-07-20  9:44   ` Ben Hutchings
2010-07-20 10:57     ` Anton Vorontsov
2010-07-20 11:50       ` Ben Hutchings
2010-07-20 12:32         ` 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).