Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2693
b: refs/heads/master
c: 8691983
h: refs/heads/master
i:
  2691: c472beb
v: v3
  • Loading branch information
Ladislav Michl authored and Greg Kroah-Hartman committed Jun 22, 2005
1 parent 5cf3e5e commit 26b2835
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 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: 00588243053bb40d0406c7843833f8fae81294ab
refs/heads/master: 86919833dbeac668762ae7056ead2d35d070f622
7 changes: 2 additions & 5 deletions trunk/drivers/i2c/chips/ds1337.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,11 @@ static struct i2c_driver ds1337_driver = {
struct ds1337_data {
struct i2c_client client;
struct list_head list;
int id;
};

/*
* Internal variables
*/
static int ds1337_id;
static LIST_HEAD(ds1337_clients);

static inline int ds1337_read(struct i2c_client *client, u8 reg, u8 *value)
Expand Down Expand Up @@ -213,15 +211,15 @@ static int ds1337_command(struct i2c_client *client, unsigned int cmd,
* Public API for access to specific device. Useful for low-level
* RTC access from kernel code.
*/
int ds1337_do_command(int id, int cmd, void *arg)
int ds1337_do_command(int bus, int cmd, void *arg)
{
struct list_head *walk;
struct list_head *tmp;
struct ds1337_data *data;

list_for_each_safe(walk, tmp, &ds1337_clients) {
data = list_entry(walk, struct ds1337_data, list);
if (data->id == id)
if (data->client.adapter->nr == bus)
return ds1337_command(&data->client, cmd, arg);
}

Expand Down Expand Up @@ -331,7 +329,6 @@ static int ds1337_detect(struct i2c_adapter *adapter, int address, int kind)
ds1337_init_client(new_client);

/* Add client to local list */
data->id = ds1337_id++;
list_add(&data->list, &ds1337_clients);

return 0;
Expand Down

0 comments on commit 26b2835

Please sign in to comment.