Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96027
b: refs/heads/master
c: 56783c5
h: refs/heads/master
i:
  96025: 3bad6db
  96023: 18ffd8d
v: v3
  • Loading branch information
Daniel Walker authored and Paul Mackerras committed May 5, 2008
1 parent 5118446 commit a347034
Show file tree
Hide file tree
Showing 2 changed files with 6 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: 0885cb5653ff82c8d322df1b8a95843dc5f5486b
refs/heads/master: 56783c5e4dd32ca370ad0bdf3a9c6c1aaee94726
10 changes: 5 additions & 5 deletions trunk/drivers/macintosh/windfarm_smu_sat.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <linux/init.h>
#include <linux/wait.h>
#include <linux/i2c.h>
#include <linux/semaphore.h>
#include <linux/mutex.h>
#include <asm/prom.h>
#include <asm/smu.h>
#include <asm/pmac_low_i2c.h>
Expand All @@ -36,7 +36,7 @@
struct wf_sat {
int nr;
atomic_t refcnt;
struct semaphore mutex;
struct mutex mutex;
unsigned long last_read; /* jiffies when cache last updated */
u8 cache[16];
struct i2c_client i2c;
Expand Down Expand Up @@ -163,7 +163,7 @@ static int wf_sat_get(struct wf_sensor *sr, s32 *value)
if (sat->i2c.adapter == NULL)
return -ENODEV;

down(&sat->mutex);
mutex_lock(&sat->mutex);
if (time_after(jiffies, (sat->last_read + MAX_AGE))) {
err = wf_sat_read_cache(sat);
if (err)
Expand All @@ -182,7 +182,7 @@ static int wf_sat_get(struct wf_sensor *sr, s32 *value)
err = 0;

fail:
up(&sat->mutex);
mutex_unlock(&sat->mutex);
return err;
}

Expand Down Expand Up @@ -233,7 +233,7 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev)
sat->nr = -1;
sat->node = of_node_get(dev);
atomic_set(&sat->refcnt, 0);
init_MUTEX(&sat->mutex);
mutex_init(&sat->mutex);
sat->i2c.addr = (addr >> 1) & 0x7f;
sat->i2c.adapter = adapter;
sat->i2c.driver = &wf_sat_driver;
Expand Down

0 comments on commit a347034

Please sign in to comment.