tosa_battery: fix FTBFS bug due to driver_data access
PATCH 1/1 tosa_battery: fix FTBFS bug due to driver_data access
--- drivers/power/tosa_battery.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/power/tosa_battery.c +2 -2
@@ -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);
Signature · 1 line
1.7.0
Quoted 4 lines · On Tue, 27 Apr 2010 17:18:22 +0400 Dmitry Eremin-Solenikov…
Signed-off-by Dmitry Eremin-Solenikov <[email protected]>--- drivers/power/tosa_battery.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Please don't send unchangelogged patches.
Please don't send patches which require recipients to go googling acronyms to work out wtf you're up to.
<googles the acronym>
Ah, it appears to be a build fix.
Please always quote the compiler errors when fixing a build error.
IOW: bah.
PATCH 1/1 Remove tosa_battery driver (was: Re: [PATCH] tosa_battery: fix FTBFS bug due to driver_data access)
Quoted 8 lines · Andrew Morton
Quoted 4 lines · On Tue, 27 Apr 2010 17:18:22 +0400 Dmitry Eremin-Solenikov…
Signed-off-by Dmitry Eremin-Solenikov <[email protected]>--- drivers/power/tosa_battery.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Quoted 8 lines
Please don't send unchangelogged patches.
Please don't send patches which require recipients to go googling acronyms to work out wtf you're up to.
<googles the acronym>
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?
- - - -
Quoted 1 line
From
464e18bb5c7230daaa741d308f76cf0671be4bf2Mon Sep 17 00:00:00 2001
From: Anton Vorontsov <[email protected]>
Date: Fri, 30 Apr 2010 21:55:58 +0400
Subject: [PATCH] Remove tosa_battery driver
- The driver is broken since commit b4028437 "Driver core: move dev_get/set_drvdata to drivers/base/dd.c", i.e. since 2.6.32;
- The driver isn't selected by any ARM defconfig.
- wm97xx_battery is a more generic driver, and should be suitable as a replacement;
So, remove the tosa_battery driver.
--- drivers/power/Kconfig | 7 - drivers/power/Makefile | 1 - drivers/power/tosa_battery.c | 486 ------------------------------------------ 3 files changed, 0 insertions(+), 494 deletions(-) delete mode 100644 drivers/power/tosa_battery.c
drivers/power/Kconfig +0 -7
@@ -84,13 +84,6 @@ config BATTERY_OLPC help Say Y to enable support for the battery on the OLPC laptop. -config BATTERY_TOSA - tristate "Sharp SL-6000 (tosa) battery" - depends on MACH_TOSA && MFD_TC6393XB && TOUCHSCREEN_WM97XX - help - Say Y to enable support for the battery on the Sharp Zaurus - SL-6000 (tosa) models. - config BATTERY_COLLIE tristate "Sharp SL-5500 (collie) battery" depends on SA1100_COLLIE && MCP_UCB1200
drivers/power/Makefile +0 -1
@@ -25,7 +25,6 @@ obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o -obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o obj-$(CONFIG_BATTERY_COLLIE) += collie_battery.o obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o obj-$(CONFIG_BATTERY_BQ27x00) += bq27x00_battery.o
drivers/power/tosa_battery.c deleted +0 -486
486 lines not on this page · raw message
Signature · 1 line
1.7.0.5
Re: [PATCH] Remove tosa_battery driver (was: Re: [PATCH] tosa_battery: fix FTBFS bug due to driver_data access)
Hello,
Quoted 22 lines · Anton Vorontsov
Quoted 8 lines · Andrew Morton
Quoted 4 lines · On Tue, 27 Apr 2010 17:18:22 +0400 Dmitry Eremin-Solenikov…
Signed-off-by Dmitry Eremin-Solenikov <[email protected]>---
drivers/power/tosa_battery.c | 4 ++--1 files changed, 2 insertions(+), 2 deletions(-)Quoted 8 lines
Please don't send unchangelogged patches.
Please don't send patches which require recipients to go googling acronyms to work out wtf you're up to.
<googles the acronym>
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 todrivers/base/dd.c").
Quoted 8 lines
Also, IIRC it was deprecated in favor of
wm97xx_battery.cdriver.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.
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH] Remove tosa_battery driver (was: Re: [PATCH] tosa_battery: fix FTBFS bug due to driver_data access)
On Sat, May 01, 2010 at 12:40:54AM +0400, Dmitry Eremin-Solenikov wrote:
[...]
Quoted 13 lines
Quoted 13 lines
Quoted 1 line
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 todrivers/base/dd.c").Also, IIRC it was deprecated in favor of
wm97xx_battery.cdriver.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.
Quoted 5 lines
Quoted 1 line
Any objections on the patch down below?
Yes.
wm97xx_batteryhandles only one battery, while tosa uses 3 different batterires.
So,wm97xx_batteryneeds 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 <[email protected]>
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.otosa_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.
--- drivers/power/tosa_battery.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/power/tosa_battery.c +2 -2
@@ -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);
Signature · 1 line
1.7.0.5
Re: [PATCH] Remove tosa_battery driver (was: Re: [PATCH] tosa_battery: fix FTBFS bug due to driver_data access)
Quoted 15 lines · Anton Vorontsov
On Sat, May 01, 2010 at 12:40:54AM +0400, Dmitry Eremin-Solenikov wrote:
[...]Quoted 13 lines
Quoted 13 lines
Quoted 1 line
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 todrivers/base/dd.c").Also, IIRC it was deprecated in favor of
wm97xx_battery.cdriver.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.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Any objections on the patch down below?
Yes.
wm97xx_batteryhandles only one battery, while tosa uses 3 different batterires.
So,wm97xx_batteryneeds 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.
Quoted 51 lines
- - -
From: Dmitry Eremin-Solenikov <[email protected]>
Date: Tue, 27 Apr 2010 17:18:22 +0400
Subject: [PATCH]tosa_battery: Fix build error due to directdriver_datausageThe driver isn't buildable since 2.6.32 (i.e. commit
b4028437"Driver core: move dev_get/set_drvdata todrivers/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_datadirectly, usedev_get_drvdata()instead.Signed-off-by Dmitry Eremin-Solenikov <[email protected]>Signed-off-by Andrew Morton <[email protected]>Signed-off-by Anton Vorontsov <[email protected]>---
drivers/power/tosa_battery.c | 4 ++--1 files changed, 2 insertions(+), 2 deletions(-)drivers/power/tosa_battery.c +2
-3@@ -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
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH] Remove tosa_battery driver (was: Re: [PATCH] tosa_battery: fix FTBFS bug due to driver_data access)
Quoted 7 lines · Dmitry Eremin-Solenikov
Quoted 2 lines · Anton Vorontsov
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.
TBH I'm not entirely sure it's worth it - I'd be somewhat surprised to see users outside of tosa for the more complex functionality.