All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Marek Vasut <marek.vasut@gmail.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] Remove tosa_battery driver (was: Re: [PATCH] tosa_battery: fix FTBFS bug due to driver_data access)
Date: Mon, 3 May 2010 00:12:02 +0400	[thread overview]
Message-ID: <20100502201202.GA18647@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <g2qbc64b4641004301340h3c942f3cn40de735b419b8535@mail.gmail.com>

On Sat, May 01, 2010 at 12:40:54AM +0400, Dmitry Eremin-Solenikov wrote:
[...]
> >> Ah, it appears to be a build fix.
> >
> > It seems that the driver isn't buildable since 2.6.32
> > (i.e. commit b4028437 "Driver core: move dev_get/set_drvdata to
> > drivers/base/dd.c").
> >
> > Also, IIRC it was deprecated in favor of wm97xx_battery.c
> > driver.
> >
> > So, I'm not picking this patch for 2.6.34, it's not a
> > new regression, and the driver is probably needs to be
> > removed.
> >
> > Any objections on the patch down below?
> 
> Yes. wm97xx_battery handles only one battery, while tosa uses 3
> different batterires.
> So, wm97xx_battery needs to be adapted/enhanced.

Eh. I see, thanks for making this clear. I added some changelog
and applied the following patch to battery-2.6.git:

- - -
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Date: Tue, 27 Apr 2010 17:18:22 +0400
Subject: [PATCH] tosa_battery: Fix build error due to direct driver_data usage

The driver isn't buildable since 2.6.32 (i.e. commit b4028437
"Driver core: move dev_get/set_drvdata to drivers/base/dd.c"):

  CC      tosa_battery.o
tosa_battery.c: In function 'tosa_read_bat':
tosa_battery.c:64: error: 'struct device' has no member named 'driver_data'
tosa_battery.c: In function 'tosa_read_temp':
tosa_battery.c:84: error: 'struct device' has no member named 'driver_data'

Nowadays we must not access driver_data directly, use dev_get_drvdata()
instead.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
---
 drivers/power/tosa_battery.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/tosa_battery.c b/drivers/power/tosa_battery.c
index 2eab35a..ee04936 100644
--- a/drivers/power/tosa_battery.c
+++ b/drivers/power/tosa_battery.c
@@ -61,7 +61,7 @@ static unsigned long tosa_read_bat(struct tosa_bat *bat)
 	mutex_lock(&bat_lock);
 	gpio_set_value(bat->gpio_bat, 1);
 	msleep(5);
-	value = wm97xx_read_aux_adc(bat->psy.dev->parent->driver_data,
+	value = wm97xx_read_aux_adc(dev_get_drvdata(bat->psy.dev->parent),
 			bat->adc_bat);
 	gpio_set_value(bat->gpio_bat, 0);
 	mutex_unlock(&bat_lock);
@@ -81,7 +81,7 @@ static unsigned long tosa_read_temp(struct tosa_bat *bat)
 	mutex_lock(&bat_lock);
 	gpio_set_value(bat->gpio_temp, 1);
 	msleep(5);
-	value = wm97xx_read_aux_adc(bat->psy.dev->parent->driver_data,
+	value = wm97xx_read_aux_adc(dev_get_drvdata(bat->psy.dev->parent),
 			bat->adc_temp);
 	gpio_set_value(bat->gpio_temp, 0);
 	mutex_unlock(&bat_lock);
-- 
1.7.0.5


  reply	other threads:[~2010-05-02 20:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-27 13:18 [PATCH] tosa_battery: fix FTBFS bug due to driver_data access Dmitry Eremin-Solenikov
2010-04-27 22:48 ` Andrew Morton
2010-04-30 18:13   ` [PATCH] Remove tosa_battery driver (was: Re: [PATCH] tosa_battery: fix FTBFS bug due to driver_data access) Anton Vorontsov
2010-04-30 20:40     ` Dmitry Eremin-Solenikov
2010-05-02 20:12       ` Anton Vorontsov [this message]
2010-05-02 20:52         ` Dmitry Eremin-Solenikov
2010-05-04 14:56           ` Mark Brown

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=20100502201202.GA18647@oksana.dev.rtsoft.ru \
    --to=cbouatmailru@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    /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.