projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
[powerpc.git]
/
drivers
/
hwmon
/
lm70.c
diff --git
a/drivers/hwmon/lm70.c
b/drivers/hwmon/lm70.c
index
30b9b2b
..
d435f00
100644
(file)
--- a/
drivers/hwmon/lm70.c
+++ b/
drivers/hwmon/lm70.c
@@
-31,14
+31,15
@@
#include <linux/err.h>
#include <linux/sysfs.h>
#include <linux/hwmon.h>
#include <linux/err.h>
#include <linux/sysfs.h>
#include <linux/hwmon.h>
+#include <linux/mutex.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi.h>
-#include <asm/semaphore.h>
+
#define DRVNAME "lm70"
struct lm70 {
#define DRVNAME "lm70"
struct lm70 {
- struct
class_device *c
dev;
- struct
semaphore sem
;
+ struct
device *hwmon_
dev;
+ struct
mutex lock
;
};
/* sysfs hook function */
};
/* sysfs hook function */
@@
-51,7
+52,7
@@
static ssize_t lm70_sense_temp(struct device *dev,
s16 raw=0;
struct lm70 *p_lm70 = dev_get_drvdata(&spi->dev);
s16 raw=0;
struct lm70 *p_lm70 = dev_get_drvdata(&spi->dev);
- if (
down_interruptible(&p_lm70->sem
))
+ if (
mutex_lock_interruptible(&p_lm70->lock
))
return -ERESTARTSYS;
/*
return -ERESTARTSYS;
/*
@@
-83,7
+84,7
@@
static ssize_t lm70_sense_temp(struct device *dev,
val = ((int)raw/32) * 250;
status = sprintf(buf, "%d\n", val); /* millidegrees Celsius */
out:
val = ((int)raw/32) * 250;
status = sprintf(buf, "%d\n", val); /* millidegrees Celsius */
out:
-
up(&p_lm70->sem
);
+
mutex_unlock(&p_lm70->lock
);
return status;
}
return status;
}
@@
-112,13
+113,13
@@
static int __devinit lm70_probe(struct spi_device *spi)
if (!p_lm70)
return -ENOMEM;
if (!p_lm70)
return -ENOMEM;
-
init_MUTEX(&p_lm70->sem
);
+
mutex_init(&p_lm70->lock
);
/* sysfs hook */
/* sysfs hook */
- p_lm70->
c
dev = hwmon_device_register(&spi->dev);
- if (IS_ERR(p_lm70->
c
dev)) {
+ p_lm70->
hwmon_
dev = hwmon_device_register(&spi->dev);
+ if (IS_ERR(p_lm70->
hwmon_
dev)) {
dev_dbg(&spi->dev, "hwmon_device_register failed.\n");
dev_dbg(&spi->dev, "hwmon_device_register failed.\n");
- status = PTR_ERR(p_lm70->
c
dev);
+ status = PTR_ERR(p_lm70->
hwmon_
dev);
goto out_dev_reg_failed;
}
dev_set_drvdata(&spi->dev, p_lm70);
goto out_dev_reg_failed;
}
dev_set_drvdata(&spi->dev, p_lm70);
@@
-133,7
+134,7
@@
static int __devinit lm70_probe(struct spi_device *spi)
out_dev_create_file_failed:
device_remove_file(&spi->dev, &dev_attr_temp1_input);
out_dev_create_file_failed:
device_remove_file(&spi->dev, &dev_attr_temp1_input);
- hwmon_device_unregister(p_lm70->
c
dev);
+ hwmon_device_unregister(p_lm70->
hwmon_
dev);
out_dev_reg_failed:
dev_set_drvdata(&spi->dev, NULL);
kfree(p_lm70);
out_dev_reg_failed:
dev_set_drvdata(&spi->dev, NULL);
kfree(p_lm70);
@@
-146,7
+147,7
@@
static int __devexit lm70_remove(struct spi_device *spi)
device_remove_file(&spi->dev, &dev_attr_temp1_input);
device_remove_file(&spi->dev, &dev_attr_name);
device_remove_file(&spi->dev, &dev_attr_temp1_input);
device_remove_file(&spi->dev, &dev_attr_name);
- hwmon_device_unregister(p_lm70->
c
dev);
+ hwmon_device_unregister(p_lm70->
hwmon_
dev);
dev_set_drvdata(&spi->dev, NULL);
kfree(p_lm70);
dev_set_drvdata(&spi->dev, NULL);
kfree(p_lm70);