All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Huewe <PeterHuewe@gmx.de>
To: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: Mike Rapoport <mike@compulab.co.il>,
	Wolfram Sang <w.sang@pengutronix.de>, Tejun Heo <tj@kernel.org>,
	Ryan Mallon <ryan@bluewatersys.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] power: Rename get_current to fix build failure / name conflict
Date: Thu, 13 May 2010 01:54:57 +0200	[thread overview]
Message-ID: <201005130154.58459.PeterHuewe@gmx.de> (raw)

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, &current_uA);
+	err = info->ops->get_battery_current(info, &current_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


             reply	other threads:[~2010-05-12 23:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-12 23:54 Peter Huewe [this message]
2010-05-13  0:32 ` [PATCH] power: Rename get_current to fix build failure / name conflict Ryan Mallon
2010-05-13  5:27 ` Mike Rapoport
2010-06-14 15:12   ` Peter Huewe
2010-06-14 15:12     ` Peter Huewe
2010-06-14 15:41     ` [PATCH] power: Rename get_current to fix build failure / name Anton Vorontsov
2010-06-14 15:41       ` [PATCH] power: Rename get_current to fix build failure / name conflict 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=201005130154.58459.PeterHuewe@gmx.de \
    --to=peterhuewe@gmx.de \
    --cc=cbouatmailru@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike@compulab.co.il \
    --cc=ryan@bluewatersys.com \
    --cc=tj@kernel.org \
    --cc=w.sang@pengutronix.de \
    /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.