diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-05 15:48:53 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-05 15:48:53 -0700 |
commit | 2e83fc4df5f27dfc1b53044c4f142b2f9d1db08c (patch) | |
tree | 6afd0fe3aba28ed7137a9b2916a8a6d517ff9c04 /drivers/macintosh/windfarm_smu_sat.c | |
parent | 17aa7e034416e3080bc57a786d09ba0a4a044561 (diff) | |
parent | 9185ef6787f1c8f1c06aa0cb3c7746fb4f101f50 (diff) | |
download | kernel_samsung_smdk4412-2e83fc4df5f27dfc1b53044c4f142b2f9d1db08c.zip kernel_samsung_smdk4412-2e83fc4df5f27dfc1b53044c4f142b2f9d1db08c.tar.gz kernel_samsung_smdk4412-2e83fc4df5f27dfc1b53044c4f142b2f9d1db08c.tar.bz2 |
Merge branch 'powerpc-next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'powerpc-next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
[POWERPC] Assign PDE->data before gluing PDE into /proc tree
[POWERPC] devres: Add devm_ioremap_prot()
[POWERPC] macintosh: ADB driver: adb_handler_sem semaphore to mutex
[POWERPC] macintosh: windfarm_smu_sat: semaphore to mutex
[POWERPC] macintosh: therm_pm72: driver_lock semaphore to mutex
Diffstat (limited to 'drivers/macintosh/windfarm_smu_sat.c')
-rw-r--r-- | drivers/macintosh/windfarm_smu_sat.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index 797918d..7f2be4b 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c @@ -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> @@ -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; |