Skip to content

Commit

Permalink
tosa_battery: Fix build error due to direct driver_data usage
Browse files Browse the repository at this point in the history
The driver isn't buildable since 2.6.32 (i.e. commit b402843
"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>
  • Loading branch information
Dmitry Eremin-Solenikov authored and Anton Vorontsov committed May 2, 2010
1 parent b1458fb commit 06b9e65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/power/tosa_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 06b9e65

Please sign in to comment.