lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 3 May 2010 00:52:48 +0400
From:	Dmitry Eremin-Solenikov <dbaryshkov@...il.com>
To:	Anton Vorontsov <cbouatmailru@...il.com>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	David Woodhouse <dwmw2@...radead.org>,
	Marek Vasut <marek.vasut@...il.com>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] Remove tosa_battery driver (was: Re: [PATCH] 
	tosa_battery: fix FTBFS bug due to driver_data access)

On Mon, May 3, 2010 at 12:12 AM, Anton Vorontsov <cbouatmailru@...il.com> wrote:
> 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:

Thank you. Merging these two drivers is on my goal list, but it won't
come in the near future.

>
> - - -
> From: Dmitry Eremin-Solenikov <dbaryshkov@...il.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@...il.com>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Anton Vorontsov <cbouatmailru@...il.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
>
>



-- 
With best wishes
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ