From a34703415eae89f9084092a9eb0175673536833c Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Sat, 3 May 2008 06:34:02 +1000 Subject: [PATCH] --- yaml --- r: 96027 b: refs/heads/master c: 56783c5e4dd32ca370ad0bdf3a9c6c1aaee94726 h: refs/heads/master i: 96025: 3bad6dbb23fb3b41959cf6ff638ee7d723171842 96023: 18ffd8d81d22d49d907842b3892d2131c2eaad3a v: v3 --- [refs] | 2 +- trunk/drivers/macintosh/windfarm_smu_sat.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 8eed8866f2c3..1824bee00b8d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0885cb5653ff82c8d322df1b8a95843dc5f5486b +refs/heads/master: 56783c5e4dd32ca370ad0bdf3a9c6c1aaee94726 diff --git a/trunk/drivers/macintosh/windfarm_smu_sat.c b/trunk/drivers/macintosh/windfarm_smu_sat.c index 797918d0e59c..7f2be4baaeda 100644 --- a/trunk/drivers/macintosh/windfarm_smu_sat.c +++ b/trunk/drivers/macintosh/windfarm_smu_sat.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -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; @@ -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) @@ -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; } @@ -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;