All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Anton Vorontsov <cbou@mail.ru>, David Woodhouse <dwmw2@infradead.org>
Cc: Yulia Vilensky <vilensky@compulab.co.il>,
	Geert Stappers <stappers@stappers.nl>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] ds2782_battery: Rename get_current and get_voltage operations
Date: Tue, 20 Jul 2010 01:02:55 +0100	[thread overview]
Message-ID: <1279584175.4883.226.camel@localhost> (raw)

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



             reply	other threads:[~2010-07-20  0:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-20  0:02 Ben Hutchings [this message]
2010-07-20  7:46 ` [PATCH] ds2782_battery: Rename get_current and get_voltage operations 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1279584175.4883.226.camel@localhost \
    --to=ben@decadent.org.uk \
    --cc=cbou@mail.ru \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stappers@stappers.nl \
    --cc=vilensky@compulab.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.