Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198149
b: refs/heads/master
c: ab6cc8f
h: refs/heads/master
i:
  198147: 38aeeee
v: v3
  • Loading branch information
Anton Vorontsov committed May 2, 2010
1 parent 7e13b9d commit 55aef4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b9ade6b612e562c4a5bd02ef38cc32e10f3f9ba
refs/heads/master: ab6cc8f9b716a3d0a41b42cd81d392183211a7f2
17 changes: 11 additions & 6 deletions trunk/drivers/power/ds2782_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,18 @@ static int ds278x_battery_remove(struct i2c_client *client)
return 0;
}

enum ds278x_num_id {
DS2782 = 0,
DS2786,
};

static struct ds278x_battery_ops ds278x_ops[] = {
[0] = {
[DS2782] = {
.get_current = ds2782_get_current,
.get_voltage = ds2782_get_voltage,
.get_capacity = ds2782_get_capacity,
},
[1] = {
[DS2786] = {
.get_current = ds2786_get_current,
.get_voltage = ds2786_get_voltage,
.get_capacity = ds2786_get_capacity,
Expand All @@ -325,7 +330,7 @@ static int ds278x_battery_probe(struct i2c_client *client,
* ds2786 should have the sense resistor value set
* in the platform data
*/
if (id->driver_data == 1 && !pdata) {
if (id->driver_data == DS2786 && !pdata) {
dev_err(&client->dev, "missing platform data for ds2786\n");
return -EINVAL;
}
Expand Down Expand Up @@ -355,7 +360,7 @@ static int ds278x_battery_probe(struct i2c_client *client,
goto fail_name;
}

if (id->driver_data == 1)
if (id->driver_data == DS2786)
info->rsns = pdata->rsns;

i2c_set_clientdata(client, info);
Expand Down Expand Up @@ -385,8 +390,8 @@ static int ds278x_battery_probe(struct i2c_client *client,
}

static const struct i2c_device_id ds278x_id[] = {
{"ds2782", 0},
{"ds2786", 1},
{"ds2782", DS2782},
{"ds2786", DS2786},
{},
};

Expand Down

0 comments on commit 55aef4e

Please sign in to comment.