Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25778
b: refs/heads/master
c: 8c750c0
h: refs/heads/master
v: v3
  • Loading branch information
Mark A. Greer authored and Greg Kroah-Hartman committed Apr 14, 2006
1 parent 3c2f796 commit 02018c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: 524465df2accf54604cb89c04dbaab0c8aaa5bb4
refs/heads/master: 8c750c0bd2fa6f73cd3cd3f1a58d48f94de343b6
16 changes: 9 additions & 7 deletions trunk/drivers/i2c/chips/m41t00.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/rtc.h>
#include <linux/bcd.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>

#include <asm/time.h>
#include <asm/rtc.h>
Expand Down Expand Up @@ -111,7 +112,7 @@ m41t00_get_rtc_time(void)
}

static void
m41t00_set_tlet(ulong arg)
m41t00_set(void *arg)
{
struct rtc_time tm;
ulong nowtime = *(ulong *)arg;
Expand Down Expand Up @@ -145,19 +146,19 @@ m41t00_set_tlet(ulong arg)
return;
}

static ulong new_time;

DECLARE_TASKLET_DISABLED(m41t00_tasklet, m41t00_set_tlet, (ulong)&new_time);
static ulong new_time;
static struct workqueue_struct *m41t00_wq;
static DECLARE_WORK(m41t00_work, m41t00_set, &new_time);

int
m41t00_set_rtc_time(ulong nowtime)
{
new_time = nowtime;

if (in_interrupt())
tasklet_schedule(&m41t00_tasklet);
queue_work(m41t00_wq, &m41t00_work);
else
m41t00_set_tlet((ulong)&new_time);
m41t00_set(&new_time);

return 0;
}
Expand Down Expand Up @@ -189,6 +190,7 @@ m41t00_probe(struct i2c_adapter *adap, int addr, int kind)
return rc;
}

m41t00_wq = create_singlethread_workqueue("m41t00");
save_client = client;
return 0;
}
Expand All @@ -206,7 +208,7 @@ m41t00_detach(struct i2c_client *client)

if ((rc = i2c_detach_client(client)) == 0) {
kfree(client);
tasklet_kill(&m41t00_tasklet);
destroy_workqueue(m41t00_wq);
}
return rc;
}
Expand Down

0 comments on commit 02018c8

Please sign in to comment.